[vlc-devel] [RFC PATCH 3.0.x] input: clear EOF flags of slave sources when select track

Rémi Denis-Courmont remi at remlab.net
Mon Nov 16 15:59:18 CET 2020


Le lundi 16 novembre 2020, 14:03:54 EET Thomas Guillem a écrit :
> On Sat, Nov 14, 2020, at 07:48, Zhao Zhili wrote:
> > > On Nov 14, 2020, at 2:46 AM, Rémi Denis-Courmont <remi at remlab.net>
> > > wrote:
> > > 
> > > Le vendredi 13 novembre 2020, 16:06:37 EET Zhao Zhili a écrit :
> > >> input-slave was broken for some demuxers like mp4. If no track is
> > >> selected, slave demuxer return EOF at the beginning. Selecting
> > >> a track of slave input doesn't work since the input source is
> > >> in the EOF status. For VLC users, seeking after select track is a
> > >> workaround solution, because seek will reset the EOF flag.
> > >> 
> > >> Since a video track can be enabled at random position and there is
> > >> no preroll, it can lead to corrupted frames.
> > > 
> > > I don't think you can simply undo the EOS flag. AFAIK, demuxers are not
> > > *generally* robust enough to return EOS repeatedly.
> > > 
> > > Most likely some demuxers return a fatal error or even crash if you try
> > > to
> > > demux after EOS (without first seeking). We can agree that that's a bug
> > > in any affected demuxers ... in 4.0. But we can't just decree a change
> > > in the API semantics, without first reviewing the demuxers.
> > 
> > There are two other methods:
> > 1. Trigger SlaveSeek() when selecting track.
> 
> If the seek is done only on the EOF slave, then such workaround is OK for
> me.

I don't think that would work. In fact, seeking is problematic as it is - 
because different sources may have different precision.

But in this case, we *must* seek the demuxer that returned EOF. And IMU, 
that's the maine one.

-- 
Rémi Denis-Courmont




More information about the vlc-devel mailing list