decodebin3: fix output->decoder_{sink,src} leak
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 1 Aug 2016 11:35:16 +0000 (13:35 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Wed, 3 Aug 2016 15:49:45 +0000 (17:49 +0200)
output->decoder_sink and output->decoder_src are both going to be
replaced in the 2 branches of the following 'if'.

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

gst/playback/gstdecodebin3.c

index 2e7ff6b..34d1b02 100644 (file)
@@ -1817,9 +1817,6 @@ reconfigure_output_stream (DecodebinOutputStream * output,
       goto cleanup;
     }
 
-    gst_object_replace ((GstObject **) & output->decoder_sink, NULL);
-    gst_object_replace ((GstObject **) & output->decoder_src, NULL);
-
     gst_element_set_locked_state (output->decoder, TRUE);
     gst_element_set_state (output->decoder, GST_STATE_NULL);
 
@@ -1829,6 +1826,9 @@ reconfigure_output_stream (DecodebinOutputStream * output,
 
   gst_caps_unref (new_caps);
 
+  gst_object_replace ((GstObject **) & output->decoder_sink, NULL);
+  gst_object_replace ((GstObject **) & output->decoder_src, NULL);
+
   /* If a decoder is required, create one */
   if (needs_decoder) {
     /* If we don't have a decoder yet, instantiate one */