[vlc-devel] [PATCH 3/3] mediacodec: implementation of MediaCodec direct rendering based on the work by Martin Storsjö.
martin at martin.st
Sat Dec 14 23:50:02 CET 2013
On Sat, 14 Dec 2013, Felix Abecassis wrote:
> 2013/12/13 Martin Storsjö <martin at martin.st>:
>> In general this seems to work pretty well on my Galaxy S3 now - kudos for
>> that. However, if pausing the video, waiting for a little while (a few
>> seconds) and then pressing the back key to exit, something somewhere seems
>> to deadlock.
> Which sample did you use?
I ran into the issue with the casino royale trailer that I think I've
shared with you before. I don't run into it with a few other samples, and
not on my Nexus 7 either.
I had a quick look at what's happening, and looks like something that can
happen on almost any device/sample: The decoder has used up all the output
buffers so it's blocked in DecodeVideo waiting for a free input or output
buffer. Since the video gets paused, it won't try to render any more of
the buffered pictures yet, so the decoder thread is basically blocked
there until somebody frees one of the buffered pictures. Now when I press
the back key to exit, it doesn't free the list of already output pictures
(not just yet at least), probably waiting for the DecodeVideo call to
So something from elsewhere would need to tell the video decoder thread to
give up/abort, alternatively something (the vout?) should start to
free/release the buffered pictures before the decoder thread has finished.
Pausing the video and then exiting probably isn't the most common use case
but still not uncommon IMO.
More information about the vlc-devel