Ignore Webm and MKV video files

Started by v0lt,

v0lt

I use BASS to play audio files in DirectShow player. I try to exclude video files by extension, but it doesn't always work for WebM and MKV (basswebm.dll).

Please make it possible to configure BASS so that it doesn't open WebM and MKV files that have a video track.

PS: There is a similar solution for MP4 and MOV.
BASS_SetConfig(BASS_CONFIG_MP4_VIDEO, FALSE));

Ian @ un4seen

To simplify things, the existing BASS_CONFIG_MF_VIDEO option is being renamed to BASS_CONFIG_VIDEO and applied to all file formats (so only one option needs to be set) in the next BASS release, with the relevant add-ons updated to support that. Here's a BASSWEBM update already now for you to try:

    www.un4seen.com/stuff/basswebm.zip

v0lt

#2
I updated the components
bass.dll 2.4.17.41
basswebm.dll 2.4.0.4
I try to open mka or webm audio files and get a hang when calling the BASS_StreamCreateFile function.

PS: sample https://samples.ffmpeg.org/A-codecs/AAC/Major%2006%20kwestia%2003.mka

Ian @ un4seen

Strange, BASS_StreamCreateFile isn't hanging with that file here. Can you reproduce the problem with the pre-compiled PLUGINS.EXE example in the BASS package (C\BIN folder)? If so, please provide a dump file of that to have a look at. You can get a dump using Task Manager's "Create dump file" option, and then ZIP and upload it here:

    ftp://ftp.un4seen.com/incoming/

v0lt

PLUGINS.EXE works fine.
I built the x64 version (VS2019) and it works fine too.
In the example the call is like this:
if (!BASS_Init(-1, 44100, 0, win, NULL)) {
...
if (!(chan = BASS_StreamCreateFile(FALSE, file, 0, 0, BASS_SAMPLE_LOOP | BASS_SAMPLE_FLOAT))) {

But mine is like this.
EXECUTE_ASSERT(BASS_Init(0, 44100, 0, GetDesktopWindow(), nullptr));
EXECUTE_ASSERT(BASS_SetConfigPtr(BASS_CONFIG_NET_AGENT, LABEL_BassAudioSource));
EXECUTE_ASSERT(BASS_SetConfig(BASS_CONFIG_MF_VIDEO, FALSE));
EXECUTE_ASSERT(BASS_SetConfig(BASS_CONFIG_MF_DISABLE, TRUE));
for (const auto pligin : BassPlugins) {
    LoadBassPlugin(pligin);
}
EXECUTE_ASSERT(BASS_SetConfig(BASS_CONFIG_MP4_VIDEO, FALSE));
EXECUTE_ASSERT(BASS_SetConfig(BASS_CONFIG_WMA_VIDEO, FALSE));

m_stream = BASS_StreamCreateFile(FALSE, (const void*)path.c_str(), 0, 0, BASS_STREAM_DECODE | BASS_UNICODE);
It works for mp3 but freezes for mka.

v0lt

PS: I found a bug in PLUGINS.EXE.
If I put basszxtune.dll in the same folder, the "Open file..." button does not work.

Ian @ un4seen

Quote from: v0ltBut mine is like this.
EXECUTE_ASSERT(BASS_Init(0, 44100, 0, GetDesktopWindow(), nullptr));
EXECUTE_ASSERT(BASS_SetConfigPtr(BASS_CONFIG_NET_AGENT, LABEL_BassAudioSource));
EXECUTE_ASSERT(BASS_SetConfig(BASS_CONFIG_MF_VIDEO, FALSE));
EXECUTE_ASSERT(BASS_SetConfig(BASS_CONFIG_MF_DISABLE, TRUE));
for (const auto pligin : BassPlugins) {
    LoadBassPlugin(pligin);
}
EXECUTE_ASSERT(BASS_SetConfig(BASS_CONFIG_MP4_VIDEO, FALSE));
EXECUTE_ASSERT(BASS_SetConfig(BASS_CONFIG_WMA_VIDEO, FALSE));

m_stream = BASS_StreamCreateFile(FALSE, (const void*)path.c_str(), 0, 0, BASS_STREAM_DECODE | BASS_UNICODE);
It works for mp3 but freezes for mka.

Are you loading other plugins besides BASSWEBM? If so, perhaps it's getting stuck in one those. Please upload a dump file from your test to check where exactly it's stuck.

Quote from: v0ltPS: I found a bug in PLUGINS.EXE.
If I put basszxtune.dll in the same folder, the "Open file..." button does not work.

Looks like the example's "filter" array isn't big enough to hold all of basszxtune's filetypes. I'll enlarge it.

v0lt

#7
Quote from: Ian @ un4seenAre you loading other plugins besides BASSWEBM? If so, perhaps it's getting stuck in one those. Please upload a dump file from your test to check where exactly it's stuck.
Yes. I load a few other plugins. I made a couple of dumps of mpc-be64.exe using Visual Studio and Task Manager.

Ian @ un4seen

Thanks. I think I see what the problem is now (it is actually in BASSWEBM), and here's another update for you to try:

    www.un4seen.com/stuff/basswebm.zip