From b0b0ae1f24f8651616b2c4709ba9136245122569 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Sat, 14 Mar 2015 18:08:15 +0000 Subject: [PATCH] streamsynchronizer: fix deadlock condition The variables could have changed when the lock was released to push a gap event. Streamsynchronizer needs to check them again before going to sleep. Bonus: fix a comment typo --- gst/playback/gststreamsynchronizer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gst/playback/gststreamsynchronizer.c b/gst/playback/gststreamsynchronizer.c index 7902ee1..d0a2d00 100644 --- a/gst/playback/gststreamsynchronizer.c +++ b/gst/playback/gststreamsynchronizer.c @@ -251,6 +251,10 @@ gst_stream_synchronizer_wait (GstStreamSynchronizer * self, GstPad * pad) return ret; } self->send_gap_event = FALSE; + + /* force a check on the loop conditions as we unlocked a + * few lines above and those variables could have changed */ + continue; } g_cond_wait (&stream->stream_finish_cond, &self->lock); @@ -554,7 +558,7 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstObject * parent, } } - /* send eos if haven't seen data. seen_data will be ture if data buffer + /* send eos if haven't seen data. seen_data will be true if data buffer * of the track have received in anytime. sink is ready if seen_data is * true, so can send GAP event. Will send EOS if sink isn't ready. The * scenario for the case is one track haven't any media data and then -- 2.7.4