Page 1 of 1

Audio cuts out after "EOF reached" message

Posted: 06 Mar 2019 17:55
by mikealeonetti
Been really going crazy on this issue. Would appreciate ANY suggestions.

I'm using libvlc with libvlc_media_new_callbacks. I have it using a buffer that gets written to in real time. The video plays no problem but the last second or few seconds of audio get cut off at the end. The video plays just fine with audio throughout. However, the last few seconds or so the audio just goes quiet. The following appears in the logs just when the audio gets cut off:

Code: Select all

2019-03-06, 11:18:29.626200: <debug> (0x00000404) [VLC] EOF reached 2019-03-06, 11:18:29.875200: <debug> (0x00000404) [VLC] waiting decoder fifos to empty
HOWEVER! I've created a minimal example using basically the same principal in the same dev environment and the minimal example WORKS and the audio does NOT cut off.

I've also tried to write an output file with the same data that VLC is reading from my buffer to see if maybe the video file is cutting off the end or the buffer corrupted. However, the test result video file written from the buffer matches the file being sent exactly. So it's not the buffer causing this issue.

I'm pretty stumped.

Windows 7 MSYS2 environment here is the VLC info

Code: Select all

2019-03-06, 10:47:24.611200: <debug> (0x000000e0) [VLC] VLC media player - 3.0.6 Vetinari 2019-03-06, 10:47:24.612200: <debug> (0x000000e0) [VLC] Copyright ▒ 1996-2018 the VideoLAN team 2019-03-06, 10:47:24.612200: <debug> (0x000000e0) [VLC] revision 3.0.6-0-g5803e85f73 2019-03-06, 10:47:24.612200: <debug> (0x000000e0) [VLC] configured with /scripts/mingw-w64-vlc/src/vlc-3.0.6/configure '--prefix=/mingw32' '--sysconfdir=/mingw32/etc' '--build=i686-w64-mingw32' '--host=i686-w64-mingw32' '--target=i686-w64-mingw32' '--enable-qt' '--disable-ncurses' '--disable-dbus' '--disable-telx' '--enable-nls' '--disable-lua' '--disable-gst-decode' 'build_alias=i686-w64-mingw32' 'host_alias=i686-w64-mingw32' 'target_alias=i686-w64-mingw32' 'CFLAGS=-march=i686 -mtune=generic -O2 -pipe' 'LDFLAGS=-pipe' 'CPPFLAGS=-D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -IC:/building/msys64/mingw32/include/QtGui/5.12.0/QtGui' 'CXXFLAGS=-march=i686 -mtune=generic -O2 -pipe' 'BUILDCC=/mingw32/bin/gcc' 'PKG_CONFIG_PATH=/mingw32/lib/pkgconfig:/mingw32/share/pkgconfig'

This is the code in full. Excuse all of the debug logging stuff. I've been going crazy trying to find out what's wrong:
https://pastebin.com/vhzR6vV0

Here is the minimal example I've created that works:
https://pastebin.com/fFr6XUHP

Re: Audio cuts out after "EOF reached" message

Posted: 08 Mar 2019 17:06
by mikealeonetti
I broke down and tried with libvlc_media_new_path and that does NOT cut out after 3 seconds. Here is the code https://pastebin.com/SwVpi5bJ

Then what could be wrong with the callbacks? The documentation suggests that it may have multiple calls to open_cb but it only says that if I use multiple players with the same buffer. But could that be my problem?

Re: Audio cuts out after "EOF reached" message

Posted: 10 Mar 2019 11:51
by Jean-Baptiste Kempf
I broke down and tried with libvlc_media_new_path and that does NOT cut out after 3 seconds. Here is the code https://pastebin.com/SwVpi5bJ

Then what could be wrong with the callbacks? The documentation suggests that it may have multiple calls to open_cb but it only says that if I use multiple players with the same buffer. But could that be my problem?
What OS are you on?

Re: Audio cuts out after "EOF reached" message

Posted: 10 Mar 2019 18:08
by mikealeonetti
Windows 7 Home 64-bit latest updates

Re: Audio cuts out after "EOF reached" message

Posted: 10 Mar 2019 18:49
by Jean-Baptiste Kempf
Are you using DirectSound for the audio (check the messages)?

Re: Audio cuts out after "EOF reached" message

Posted: 11 Mar 2019 14:42
by mikealeonetti
Yes it is
2019-03-04, 14:40:39.411000: <warn> (0x00000ea0) [VLC] decoded zero sample
2019-03-04, 14:40:39.411000: <debug> (0x00000ea0) [VLC] reusing audio output
2019-03-04, 14:40:39.411000: <debug> (0x00000ea0) [VLC] Opening DirectSound Audio Output

Re: Audio cuts out after "EOF reached" message

Posted: 11 Mar 2019 17:08
by Jean-Baptiste Kempf
Yes, this is a known bug. We will fix quite soon.

Re: Audio cuts out after "EOF reached" message

Posted: 12 Mar 2019 14:38
by mikealeonetti
Thank you for getting back to me so quickly. Do you have a link to the bug so I can track it?

Also, is there a good work around for the time being?

Thanks so much.

Re: Audio cuts out after "EOF reached" message

Posted: 12 Mar 2019 14:41
by Jean-Baptiste Kempf
The workaround is to use Wasapi and not directsound