[vlc-devel] [PATCH] decoder: empty the input fifo on delete

Thomas Guillem thomas at gllm.fr
Thu Sep 3 08:53:08 CEST 2015



On Wed, Sep 2, 2015, at 14:19, Rémi Denis-Courmont wrote:
> Le 2015-09-02 15:10, Thomas Guillem a écrit :
> > On Wed, Sep 2, 2015, at 13:24, Rémi Denis-Courmont wrote:
> >> Le 2015-09-02 14:05, Rémi Denis-Courmont a écrit :
> >> > Le 2015-09-02 13:54, Rémi Denis-Courmont a écrit :
> >> >> Or stop was requested, and the decoder owner should have flushed 
> >> the
> >> >> decoder already.
> >> >>
> >> >> Either way, the decoder input queue should be empty already.
> >> >
> >> > It looks like ES out only explicitly flushes on seek, but not on
> >> > stop. Not sure if this should be considered a bug.
> >>
> >> And that's because DecoderFlush() waits for the decoder thread to
> >> complete flusing. Ideally it wouldn't need to do that though.
> >
> > If DecodeFlush don't wait for flushed state, we can solve this issue
> > either by calling DecoderFlush from input_DecoderDelete or by calling
> > input_DecoderFlush from ES out when deleting the decoder, right ?
> 
> I think so.

Then, a FLUSH packet will be sent to decoders just before closing. Do we
want that ?
(For the async MediaCodec, I flush from close because it's the only way
to unblock the output thread but not all decoders want to flush from
close.)

> 
> > For the DecoderThread, I didn't see that the cancellation point was
> > called only when the fifo was empty. So an other way to fix this 
> > issue
> > is to add an other cancellation point when the fifo is not empty (but 
> > I
> > would prefer calling DecoderFlush from Delete).
> 
> The obvious work-around is to call vlc_testcancel().
> 
> -- 
> Rémi Denis-Courmont
> http://www.remlab.net/
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list