[vlc-devel] [PATCH 2/2] decoder: fix input_DecoderWait deadlock

Rémi Denis-Courmont remi at remlab.net
Tue Dec 15 10:46:56 CET 2015

Le 2015-12-11 15:17, Thomas Guillem a écrit :
> I don't feely ready to get rid of input_DecoderWait and rewrite 
> es_out, at
> least, not for 3.0.

So you are giving up on asynchronous decoding then?

input_DecoderWait() waits for the decoder thread to output some decoded 
content. There is a corner case whereby the decoder thread drains its 
entire input FIFO without outputting anything. In that case, 
input_DecoderWait() would deadlock. So it gets short-circuited. There is 
currently a race condition in this exact situation. It can lead to the 
deadlock that you are trying to address.

With the new asynchronous decoding, the "corner case" becomes the norm. 
The decoder thread never outputs anything, and the decoded content comes 
from other private threads of the decoder plugin at an arbitrary point 
in time. input_DecoderWait() gets short-circuited all the time. In other 
words, it does not work.

So the questions are:

1) Is input_DecoderWait() useful anymore?

2) If so, how do you fix it the empty FIFO case? Especially 
asynchronous decoding.

3) If not so, is it not much easier to remove input_DecoderWait()?

Rémi Denis-Courmont

More information about the vlc-devel mailing list