rtpjitterbuffer: Clear clock master before unreffing
authorJan Schmidt <jan@centricular.com>
Fri, 14 Jun 2019 16:00:43 +0000 (02:00 +1000)
committerTim-Philipp Müller <tim@centricular.com>
Tue, 20 Aug 2019 10:33:43 +0000 (11:33 +0100)
Make sure to clear any master clock on the media_clock
before unreffing it to release the timer callback that's
updating the clock and keeping it reffed.

gst/rtpmanager/rtpjitterbuffer.c

index 309d68d..64d89a8 100644 (file)
@@ -103,8 +103,11 @@ rtp_jitter_buffer_finalize (GObject * object)
   if (jbuf->media_clock_synced_id)
     g_signal_handler_disconnect (jbuf->media_clock,
         jbuf->media_clock_synced_id);
-  if (jbuf->media_clock)
+  if (jbuf->media_clock) {
+    /* Make sure to clear any clock master before releasing the clock */
+    gst_clock_set_master (jbuf->media_clock, NULL);
     gst_object_unref (jbuf->media_clock);
+  }
 
   if (jbuf->pipeline_clock)
     gst_object_unref (jbuf->pipeline_clock);