Page 1 of 1

EOF reached (VLC_DEMUXER_EOF) shortly before file end locks actions

Posted: 14 Mar 2020 09:58
by psadaic
VLC_DEMUXER_EOF (main input debug: EOF reached) happens about 400 - 500 miliseconds before actual media end which causes action lock.

To be more precise I'm using libvlc_audio_set_volume method to create fade out effect on my libvlc based audio player but in the final 400 - 500 milliseconds of playback method calls make no effect even though method return success status.

Here is the problem I'm referring to:

Code: Select all

20200313-21:09:35.280200 [000055ae8a026bd0] main input debug: EOF reached 20200313-21:09:35.807774 vlc.mediaplayer: libvlc_MediaPlayerEndReached

Code: Select all

OS: Ubuntu 19.04 Kernel: 5.0.0-38-generic VLC: 3.0.8 (tested also on current nightly build, gap seems to be even bigger there) Tested on both ALSA and pulseaudio.

Ticket with full log:
https://trac.videolan.org/vlc/ticket/24311

Re: EOF reached (VLC_DEMUXER_EOF) shortly before file end locks actions

Posted: 14 Mar 2020 15:02
by Rémi Denis-Courmont
You should still be able to change the volume, but it might only apply on the next media item. Near the end, all remaining samples will fit and already be queued to the audio HAL, so there's nothing for VLC to change the volume onto.

Re: EOF reached (VLC_DEMUXER_EOF) shortly before file end locks actions

Posted: 14 Mar 2020 15:42
by psadaic
You should still be able to change the volume, but it might only apply on the next media item.
I've been testing this specifically and it does not apply for current nor next media item. All changes during that period are ignored.
Near the end, all remaining samples will fit and already be queued to the audio HAL, so there's nothing for VLC to change the volume onto.
I came to a very similar conclusion myself after going over the vlc source code.

Is there a way to reduce sample size to minimize this?
I've been testing this further and found out that with opus files this gap is even bigger (over 1 second). This is really an unacceptable behavior for my application.
All I can do now is fade out the media completely before eof period happens which will result in loosing final part of the media.

Is there any kind of workaround you could suggest me regarding this?

Re: EOF reached (VLC_DEMUXER_EOF) shortly before file end locks actions

Posted: 18 Mar 2020 12:24
by psadaic
I have bypassed this by manipulating alsa mixer directly and not using vlc volume controls at all but this really is something you should think about improving inside your library.
Since my application is limited to alsa this approach is acceptable but for anyone doing multi-platform implementation with similar functionality it could become quite a hassle.

Re: EOF reached (VLC_DEMUXER_EOF) shortly before file end locks actions

Posted: 18 Mar 2020 16:56
by Rémi Denis-Courmont
If there are no samples to apply the volume, then there's not much room for improving.

This problem should be specific to ALSA though. It should work with PA, and if it does not, then it's probably a bug in VLC.