[vlc-devel] [RFC PATCH] mediacodec: fix a deadlock when seeking on pause

Thomas Guillem thomas at gllm.fr
Wed Oct 29 11:14:43 CET 2014


On Wed, Oct 29, 2014, at 10:50, Rémi Denis-Courmont wrote:
> Le 2014-10-28 19:01, Thomas Guillem a écrit :
> > MediaCodec with direct rendering can be stuck waiting for an input
> > buffer when video is paused. Indeed, input buffers availability
> > depends on output buffers.
> 
> Then you should queue the input blocks from VLC in a FIFO and dequeue 
> them in a separate thread that waits for input buffers.

OK, that is what I started to do but without using a separate thread. It
starts to become too hacky, I'll try that solution.

> 
> The current decoder interface might inhibit dequeuing output buffers 
> asynchronously because it requires returning decoded pictures from the 
> decode callback. But that problem should not affect input buffers.
> 
> > When the video is paused, output buffers are not released or
> > displayed anymore, therefore, no more input buffers are available.
> 
> I am an idiot and a jerk so I fail to see how pause is any special.
> I would think that if you get deadlocks on pause, you will also get 
> deadlocks on any sufficiently slow frame rate or irregular frame 
> interval.
> In other words, I suspect that the real problem is just being moved 
> from pause to slow, after it was moved from stop to pause.

You're right, the problem can happen with slow frame rate, it's just
easier to reproduce with a pause. (I'll change the commits logs and
comments)

> 
> -- 
> Rémi Denis-Courmont
> _______________________________________________
> 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