[vlc-devel] [PATCH] decoder: unblock broken decoders when seeking on pause

Rémi Denis-Courmont remi at remlab.net
Tue Oct 28 12:47:40 CET 2014

Le 2014-10-28 11:43, Thomas Guillem a écrit :
> MediaCodec or iomx with direct rendering can be stuck waiting for an 
> output
> buffer when video is paused since output buffers are released by 
> vout.

I fail to see where the video output buffers are released. As far as I 
can tell, the decoder thread flushes the video output *after* the 
decoder returns. Indeed, if the video output was flushed while the 
decoder was running, it probably would not be long before crash.

> A previous hack was made in order to fix a deadlock when theses
> broken decoders were stuck and when exit was requested.

The hack is explicitly made for *broken* decoders only:

commit aec5639a63df6867032b76e71fe2add85919f992
Author: Laurent Aimar <fenrir at videolan.org>
Date:   Wed Jul 2 21:00:24 2008 +0000

     Allow to stop decoder even in infinite decoder loop (in case of 
broken decoder).

And indeed, it only works around the exit case, and only if the decoder 
returns. I don't really see anything the decoder core can perform 
(safely) in this case. If the decoder does not return at all, there you 
are screwed anyway. Ditto if the decoder gets into an infinite loop 
before exit is requested.

Ultimately, a decoder bug requires a decoder fix.

Rémi Denis-Courmont

More information about the vlc-devel mailing list