splitmuxsink: Fix assertion failure on set_property()
authorSeungha Yang <seungha.yang@navercorp.com>
Mon, 6 Jan 2020 16:20:24 +0000 (01:20 +0900)
committerSeungha Yang <seungha.yang@navercorp.com>
Mon, 6 Jan 2020 16:24:01 +0000 (01:24 +0900)
GValue might have null object.

(gst-inspect-1.0:10304): GStreamer-CRITICAL ...
    gst_object_ref_sink: assertion 'object != NULL' failed

gst/multifile/gstsplitmuxsink.c

index 373b671d7d300fe8c25b16d1d66a1900483e9fa8..7944612948062b1592d9d4f8f0d162cca7330f53 100644 (file)
@@ -731,18 +731,18 @@ gst_splitmux_sink_set_property (GObject * object, guint prop_id,
       break;
     case PROP_SINK:
       GST_OBJECT_LOCK (splitmux);
-      if (splitmux->provided_sink)
-        gst_object_unref (splitmux->provided_sink);
+      gst_clear_object (&splitmux->provided_sink);
       splitmux->provided_sink = g_value_get_object (value);
-      gst_object_ref_sink (splitmux->provided_sink);
+      if (splitmux->provided_sink)
+        gst_object_ref_sink (splitmux->provided_sink);
       GST_OBJECT_UNLOCK (splitmux);
       break;
     case PROP_MUXER:
       GST_OBJECT_LOCK (splitmux);
-      if (splitmux->provided_muxer)
-        gst_object_unref (splitmux->provided_muxer);
+      gst_clear_object (&splitmux->provided_muxer);
       splitmux->provided_muxer = g_value_get_object (value);
-      gst_object_ref_sink (splitmux->provided_muxer);
+      if (splitmux->provided_muxer)
+        gst_object_ref_sink (splitmux->provided_muxer);
       GST_OBJECT_UNLOCK (splitmux);
       break;
     case PROP_RESET_MUXER: