Commit f4d6aa71 authored by Seungha Yang's avatar Seungha Yang Committed by Edward Hervey

playbin3: Reconfigure playsink again with pad-removed

If selected streams and actived streams are matched,
do reconfigure of playsink again with pad-removed signal

https://bugzilla.gnome.org/show_bug.cgi?id=773341
parent 858ee3d9
......@@ -2970,6 +2970,8 @@ pad_removed_cb (GstElement * decodebin, GstPad * pad, GstPlayBin3 * playbin)
GstElement *combiner;
GstSourceCombine *combine;
gulong event_probe_handler;
GstStreamType stream_type = GST_STREAM_TYPE_UNKNOWN;
gchar *pad_name;
GST_DEBUG_OBJECT (playbin,
"decoded pad %s:%s removed", GST_DEBUG_PAD_NAME (pad));
......@@ -2983,10 +2985,23 @@ pad_removed_cb (GstElement * decodebin, GstPad * pad, GstPlayBin3 * playbin)
g_object_set_data (G_OBJECT (pad), "playbin.event_probe_id", NULL);
}
pad_name = gst_object_get_name (GST_OBJECT (pad));
if (g_str_has_prefix (pad_name, "video")) {
stream_type = GST_STREAM_TYPE_VIDEO;
} else if (g_str_has_prefix (pad_name, "audio")) {
stream_type = GST_STREAM_TYPE_AUDIO;
} else if (g_str_has_prefix (pad_name, "text")) {
stream_type = GST_STREAM_TYPE_TEXT;
}
g_free (pad_name);
if ((combine = g_object_get_data (G_OBJECT (pad), "playbin.combine"))) {
g_assert (combine->combiner == NULL);
g_assert (combine->srcpad == pad);
source_combine_remove_pads (playbin, combine);
playbin->active_stream_types &= ~stream_type;
goto exit;
}
......@@ -3013,6 +3028,7 @@ pad_removed_cb (GstElement * decodebin, GstPad * pad, GstPlayBin3 * playbin)
gst_element_set_state (combine->combiner, GST_STATE_NULL);
gst_bin_remove (GST_BIN_CAST (playbin), combine->combiner);
combine->combiner = NULL;
playbin->active_stream_types &= ~stream_type;
}
}
......@@ -3025,6 +3041,12 @@ pad_removed_cb (GstElement * decodebin, GstPad * pad, GstPlayBin3 * playbin)
exit:
GST_PLAY_BIN3_UNLOCK (playbin);
if ((playbin->selected_stream_types & ~playbin->active_stream_types &
(GST_STREAM_TYPE_VIDEO | GST_STREAM_TYPE_AUDIO))
== 0) {
no_more_pads_cb (decodebin, playbin);
}
return;
/* ERRORS */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment