[vlc-devel] [PATCH 2/3] vout: pause and resume the decoder pool
Thomas Guillem
thomas at gllm.fr
Thu Nov 26 19:03:03 CET 2015
This fixes a deadlock when a decoder waits for a new picture while it's pausing
or flushing in a paused state. Indeed, in that case decoder_GetPicture or
decoder_NewPicture will block indefinitely since the vout won't display (or
release) new pictures.
This deadlock was easily reproducible with avcodec using more than one threads.
---
src/video_output/video_output.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 8a70ce7..327042a 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1135,6 +1135,11 @@ static void ThreadChangePause(vout_thread_t *vout, bool is_paused, mtime_t date)
vout->p->step.timestamp = VLC_TS_INVALID;
vout->p->step.last = VLC_TS_INVALID;
}
+
+ /* Pause the decoder pool in order to unblock the decoder thread that may
+ * be waiting for a new picture. */
+ picture_pool_ChangePause(vout->p->decoder_pool, is_paused);
+
vout->p->pause.is_on = is_paused;
vout->p->pause.date = date;
}
--
2.1.4
More information about the vlc-devel
mailing list