[vlc-devel] [RFC PATCH 0/5] decoder deadlo

Thomas Guillem thomas at gllm.fr
Fri Nov 6 14:48:42 CET 2015


There are some old and new deadlock in decoder.c:

 - Deadlock when stopping a paused video (systematic on Desktop, OK on Android).
 - Deadlock when seeking a paused video (systematic)

5 patches:

1/ Fix stop when paused, it's quite obvious.

2/ frames_countdown is only decremented for Video (from DecoderPlayVideo).
Therefore, it should be incremented only for Video too ?

3/ Display one frame when flushing by incrementing frames_countdown.

4/ Deadlock easy to understand but the fix is tricky. Ideally the Decoder
thread should unblock if (!p_owner->paused || p_owner->flushing), but these
variables are not protected by the same lock/cond. That's why I decided to add
a new variable: b_pause_after_flush.

5/ Really not sure about this one, I don't understand why input_DecoderWait
waits for p_owner->b_idle and not for p_owner->b_first.

Thomas Guillem (5):
  decoder: fix deadlock when deleting a paused decoder
  decoder: frames_countdown is only for Video
  decoder: display one frame on flush
  decoder: fix deadlock when flushing paused
  decoder: don't wait if paused

 src/input/decoder.c | 51 +++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 45 insertions(+), 6 deletions(-)

-- 
2.1.4



More information about the vlc-devel mailing list