decodebin3: fix output->decoder_{sink,src} leak

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
This commit is contained in:
Guillaume Desmottes 2016-08-01 13:35:16 +02:00 committed by Edward Hervey
parent acbaa83450
commit 487ef12fd1

View file

@ -1817,9 +1817,6 @@ reconfigure_output_stream (DecodebinOutputStream * output,
goto cleanup; 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_locked_state (output->decoder, TRUE);
gst_element_set_state (output->decoder, GST_STATE_NULL); gst_element_set_state (output->decoder, GST_STATE_NULL);
@ -1829,6 +1826,9 @@ reconfigure_output_stream (DecodebinOutputStream * output,
gst_caps_unref (new_caps); 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 a decoder is required, create one */
if (needs_decoder) { if (needs_decoder) {
/* If we don't have a decoder yet, instantiate one */ /* If we don't have a decoder yet, instantiate one */