decodebin3: Don't insert duplicated streams in collection
authorEdward Hervey <edward@centricular.com>
Thu, 25 Mar 2021 09:29:41 +0000 (10:29 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 25 Mar 2021 13:17:58 +0000 (13:17 +0000)
Filter out the ones which are already present. Can happen with several input
stream which have identical collections

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1083>

gst/playback/gstdecodebin3.c

index 48d2c84..1a24225 100644 (file)
@@ -1302,7 +1302,9 @@ get_merged_collection (GstDecodebin3 * dbin)
       for (i = 0; i < nb_stream; i++) {
         GstStream *stream =
             gst_stream_collection_get_stream (input->collection, i);
-        unsorted_streams = g_list_append (unsorted_streams, stream);
+        /* Only add if not already present in the list */
+        if (!g_list_find (unsorted_streams, stream))
+          unsorted_streams = g_list_append (unsorted_streams, stream);
       }
     }
   }