From: Wim Taymans Date: Fri, 4 Oct 2013 10:11:56 +0000 (+0200) Subject: jitterbuffer: fix race in flush-start/flush-stop X-Git-Tag: 1.3.1~630 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d4892859d4ce62e6dac6bee68653469859f493f9;p=platform%2Fupstream%2Fgst-plugins-good.git jitterbuffer: fix race in flush-start/flush-stop When flush-stop arrives before we process the result of the _push() in the loop function, we might pause even though we are not flushing anymore. Fix this race by waiting for the srcpad loop function to completely pause after doing the flush-start. --- diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c index 60d384d..5539244 100644 --- a/gst/rtpmanager/gstrtpjitterbuffer.c +++ b/gst/rtpmanager/gstrtpjitterbuffer.c @@ -1337,6 +1337,8 @@ gst_rtp_jitter_buffer_sink_event (GstPad * pad, GstObject * parent, case GST_EVENT_FLUSH_START: ret = gst_pad_push_event (priv->srcpad, event); gst_rtp_jitter_buffer_flush_start (jitterbuffer); + /* wait for the loop to go into PAUSED */ + gst_pad_pause_task (priv->srcpad); break; case GST_EVENT_FLUSH_STOP: ret = gst_pad_push_event (priv->srcpad, event);