EOF reached (VLC_DEMUXER_EOF) shortly before file end locks actions

This forum is about all development around libVLC.
psadaic
New Cone
New Cone
Posts: 3
Joined: 13 Mar 2020 21:30
VLC version: 3.0.x / master
Operating System: Linux

EOF reached (VLC_DEMUXER_EOF) shortly before file end locks actions

Postby psadaic » 14 Mar 2020 09:58

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

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

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

Postby Rémi Denis-Courmont » 14 Mar 2020 15:02

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.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

psadaic
New Cone
New Cone
Posts: 3
Joined: 13 Mar 2020 21:30
VLC version: 3.0.x / master
Operating System: Linux

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

Postby psadaic » 14 Mar 2020 15:42

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?

psadaic
New Cone
New Cone
Posts: 3
Joined: 13 Mar 2020 21:30
VLC version: 3.0.x / master
Operating System: Linux

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

Postby psadaic » 18 Mar 2020 12:24

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.

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

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

Postby Rémi Denis-Courmont » 18 Mar 2020 16:56

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.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 9 guests