decodebin2: don't reverse stream topology order

This can be important for instance when a container holds multiple
tracks with the same media type, with no indication (eg tags) of
which track is the default one.

In that case, players usually pick the first track by default.

This is especially useful when using smart editing with GES, as
it will result in the same ordering as the input file that was
used as a template.

For reference, this yields the same order as ffprobe.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1549>
This commit is contained in:
Mathieu Duponchelle 2022-01-22 02:29:54 +01:00 committed by GStreamer Marge Bot
parent 52f7150de4
commit 6bcfce7501

View file

@ -1582,7 +1582,7 @@ analyze_new_pad (GstDecodeBin * dbin, GstElement * src, GstPad * pad,
if (group && !g_list_find (group->children, chain)) {
g_assert (new_chain != NULL);
*new_chain = chain = gst_decode_chain_new (dbin, group, pad);
group->children = g_list_prepend (group->children, chain);
group->children = g_list_append (group->children, chain);
}
CHAIN_MUTEX_UNLOCK (oldchain);
if (!group) {