From 62c303c2e0e6a27de17acca774bfd43aa4fc49f0 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Fri, 21 Jan 2022 00:57:16 +0100 Subject: [PATCH] encoding-profile: don't order profiles by stream ID .. when creating a profile from a discoverer info. There is no justification for the existing code, and talking with Thibault he cannot remember why the sort was in place. On the other hand, this allows GES users to not have to implement a callback for the select-tracks-for-object callback when using it to trim a single clip, which the output profile was built from: track elements will be placed in the appropriate track by default, that is the one that will be connected to the matching profile. For multi-clip timelines, the situation doesn't change, users will still have to implement a callback and do the leg work of placing track elements (if any) in a matching track (if any). Part-of: --- .../gst-plugins-base/gst-libs/gst/pbutils/encoding-profile.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/pbutils/encoding-profile.c b/subprojects/gst-plugins-base/gst-libs/gst/pbutils/encoding-profile.c index 65fd107..66e404c 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/pbutils/encoding-profile.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/pbutils/encoding-profile.c @@ -2258,13 +2258,6 @@ create_stream_profile_recurse (GstEncodingProfile * toplevel, return toplevel; } -static gint -_compare_profile_names (const GstEncodingProfile * a, - const GstEncodingProfile * b) -{ - return g_strcmp0 (a->name, b->name); -} - /** * gst_encoding_profile_from_discoverer: * @info: (transfer none): The #GstDiscovererInfo to read from @@ -2296,11 +2289,6 @@ gst_encoding_profile_from_discoverer (GstDiscovererInfo * info) g_object_unref (profile); return NULL; } - /* Sort by stream ID */ - GST_ENCODING_CONTAINER_PROFILE (profile)->encodingprofiles = - g_list_sort (GST_ENCODING_CONTAINER_PROFILE (profile)->encodingprofiles, - (GCompareFunc) _compare_profile_names); - } return (GstEncodingProfile *) profile; -- 2.7.4