]> git.sesse.net Git - vlc/commit
vout: fix a deadlock with the picture pool lock
authorFelix Abecassis <felix.abecassis@gmail.com>
Tue, 9 Sep 2014 17:29:06 +0000 (19:29 +0200)
committerFelix Abecassis <felix.abecassis@gmail.com>
Fri, 12 Sep 2014 17:51:25 +0000 (19:51 +0200)
commit22c80ce310c58f6730291b4026af9c7c8b38fb63
treeb252544f0db3c16262e169503a44864384bddd5c
parentc35f6c1be0c06204a7b9787695cfa1150c5e5f90
vout: fix a deadlock with the picture pool lock

A deadlock could occur in an high load situation where the vout and
the decoder are taking excessive amounts of time.

The vout thread repeatedly call ThreadDisplayPicture in its main loop
until it returns an error, while keeping the picture pool locked. If
no picture was recently received, the vout will redisplay the current
picture (a "refresh") by calling ThreadDisplayRenderPicture with
is_forced=true. If this refresh is excessively long, the vout thread
will be stuck in a refresh loop. The decoder cannot make any progress
since the picture pool lock is hold and the vout won't be polling for
control commands, yielding a total deadlock of the program.

This situation can be reproduced artificially by sleeping in the
decoder and decreasing variable VOUT_REDISPLAY_DELAY.

A simple solution to this issue is to exit the ThreadDisplayPicture
loop after refreshing. Since a refresh typically occurs when no new
pictures are received from the decoder, this should not decrease
performance.
src/video_output/video_output.c