gstpipeline: fix failed assertion caused by seeking pipeline with NULL clock
authorNate Bogdanowicz <natezb@gmail.com>
Sat, 2 Feb 2013 19:55:52 +0000 (11:55 -0800)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 5 Feb 2013 13:28:36 +0000 (14:28 +0100)
Under certain GST_STATE_CHANGED_PAUSED_TO_PLAYING transitions, a pipeline with
a NULL clock will fail an assertion due to an unchecked call to gst_object_ref().
This is fixed by simply adding a check and only ref-ing if the clock is not NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=693065

gst/gstpipeline.c

index a7bb9769f043f187393786f6e2e708677047b803..16d26069213e9e3f561b3fb9feee3456ac5c5cc8 100644 (file)
@@ -405,7 +405,10 @@ gst_pipeline_change_state (GstElement * element, GstStateChange transition)
         } else {
           GST_DEBUG_OBJECT (pipeline,
               "Don't need to update clock, using old clock.");
-          clock = gst_object_ref (cur_clock);
+          /* only try to ref if cur_clock is not NULL */
+          if (cur_clock)
+            gst_object_ref (cur_clock);
+          clock = cur_clock;
         }
 
         if (clock) {