From 5dc207948c9bd429b619d42780ebe2daf2afe44d Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 20 Sep 2013 10:53:29 +0200 Subject: [PATCH] rtpjitterbuffer: improve flush and shutdown There is no need to unschedule the timer in flush-start, flush-stop will remove the timers and unschedule. Unschedule the current timer before attempting to join the timer thread. --- gst/rtpmanager/gstrtpjitterbuffer.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c index d44ecbc..6d30971 100644 --- a/gst/rtpmanager/gstrtpjitterbuffer.c +++ b/gst/rtpmanager/gstrtpjitterbuffer.c @@ -1004,9 +1004,6 @@ gst_rtp_jitter_buffer_flush_start (GstRtpJitterBuffer * jitterbuffer) GST_DEBUG_OBJECT (jitterbuffer, "Disabling pop on queue"); /* this unblocks any waiting pops on the src pad task */ JBUF_SIGNAL_EVENT (priv); - /* unlock clock, we just unschedule, the entry will be released by the - * locking streaming thread. */ - unschedule_current_timer (jitterbuffer); JBUF_UNLOCK (priv); } @@ -1137,6 +1134,7 @@ gst_rtp_jitter_buffer_change_state (GstElement * element, JBUF_LOCK (priv); gst_buffer_replace (&priv->last_sr, NULL); priv->timer_running = FALSE; + unschedule_current_timer (jitterbuffer); JBUF_SIGNAL_TIMER (priv); JBUF_UNLOCK (priv); g_thread_join (priv->timer_thread); -- 2.7.4