playbin: Set custom stream-combiners to NULL and unref before finalizing

This commit is contained in:
Sebastian Dröge 2013-05-29 10:35:11 +02:00
parent f45a102c2c
commit 0dee7777ff
2 changed files with 22 additions and 1 deletions

View file

@ -1491,6 +1491,19 @@ gst_play_bin_finalize (GObject * object)
gst_object_unref (playbin->text_sink);
}
if (playbin->video_stream_combiner) {
gst_element_set_state (playbin->video_stream_combiner, GST_STATE_NULL);
gst_object_unref (playbin->video_stream_combiner);
}
if (playbin->audio_stream_combiner) {
gst_element_set_state (playbin->audio_stream_combiner, GST_STATE_NULL);
gst_object_unref (playbin->audio_stream_combiner);
}
if (playbin->text_stream_combiner) {
gst_element_set_state (playbin->text_stream_combiner, GST_STATE_NULL);
gst_object_unref (playbin->text_stream_combiner);
}
if (playbin->elements)
gst_plugin_feature_list_free (playbin->elements);
@ -3008,8 +3021,8 @@ pad_added_cb (GstElement * decodebin, GstPad * pad, GstSourceGroup * group)
GST_DEBUG_OBJECT (playbin, "adding new stream combiner %p",
combine->combiner);
gst_bin_add (GST_BIN_CAST (playbin), combine->combiner);
gst_element_set_state (combine->combiner, GST_STATE_PAUSED);
gst_bin_add (GST_BIN_CAST (playbin), combine->combiner);
}
}
@ -5144,6 +5157,13 @@ gst_play_bin_change_state (GstElement * element, GstStateChange transition)
if (playbin->text_sink)
gst_element_set_state (playbin->text_sink, GST_STATE_NULL);
if (playbin->video_stream_combiner)
gst_element_set_state (playbin->video_stream_combiner, GST_STATE_NULL);
if (playbin->audio_stream_combiner)
gst_element_set_state (playbin->audio_stream_combiner, GST_STATE_NULL);
if (playbin->text_stream_combiner)
gst_element_set_state (playbin->text_stream_combiner, GST_STATE_NULL);
/* make sure the groups don't perform a state change anymore until we
* enable them again */
groups_set_locked_state (playbin, TRUE);

View file

@ -1628,6 +1628,7 @@ GST_START_TEST (test_raw_raw_audio_stream_adder_manual_sink)
g_object_get (G_OBJECT (playbin), "audio-stream-combiner", &playbin_combiner,
NULL);
fail_unless (playbin_combiner == adder);
gst_object_unref (playbin_combiner);
/* text and video combiners should still be NULL */
g_object_get (G_OBJECT (playbin), "text-stream-combiner", &playbin_combiner,