diff --git a/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c b/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c index 6209d653b5..514cd1a77d 100644 --- a/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c +++ b/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c @@ -1177,6 +1177,23 @@ stream_in_list (GList * list, const gchar * sid) return NULL; } +static gboolean +stream_list_equal (GList * lista, GList * listb) +{ + GList *tmp; + + if (g_list_length (lista) != g_list_length (listb)) + return FALSE; + + for (tmp = lista; tmp; tmp = tmp->next) { + gchar *osid = tmp->data; + if (!stream_in_list (listb, osid)) + return FALSE; + } + + return TRUE; +} + static void update_requested_selection (GstDecodebin3 * dbin) { @@ -1253,8 +1270,15 @@ update_requested_selection (GstDecodebin3 * dbin) } beach: - /* Finally set the requested selection */ + if (stream_list_equal (tmp, dbin->requested_selection)) { + /* If the selection is equal, there is nothign to do */ + GST_DEBUG_OBJECT (dbin, "Dropping duplicate selection"); + g_list_free (tmp); + tmp = NULL; + } + if (tmp) { + /* Finally set the requested selection */ if (dbin->requested_selection) { GST_FIXME_OBJECT (dbin, "Replacing non-NULL requested_selection, what should we do ??");