mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 04:22:27 +00:00
decodebin: try harder to always expose pads in the same order
Use stream-id as sort criterion in addition to the media type. https://bugzilla.gnome.org/show_bug.cgi?id=634407
This commit is contained in:
parent
cb99c16744
commit
500b864899
1 changed files with 13 additions and 1 deletions
|
@ -3471,6 +3471,8 @@ sort_end_pads (GstDecodePad * da, GstDecodePad * db)
|
||||||
GstCaps *capsa, *capsb;
|
GstCaps *capsa, *capsb;
|
||||||
GstStructure *sa, *sb;
|
GstStructure *sa, *sb;
|
||||||
const gchar *namea, *nameb;
|
const gchar *namea, *nameb;
|
||||||
|
gchar *ida, *idb;
|
||||||
|
gint ret;
|
||||||
|
|
||||||
capsa = get_pad_caps (GST_PAD_CAST (da));
|
capsa = get_pad_caps (GST_PAD_CAST (da));
|
||||||
capsb = get_pad_caps (GST_PAD_CAST (db));
|
capsb = get_pad_caps (GST_PAD_CAST (db));
|
||||||
|
@ -3506,7 +3508,17 @@ sort_end_pads (GstDecodePad * da, GstDecodePad * db)
|
||||||
gst_caps_unref (capsa);
|
gst_caps_unref (capsa);
|
||||||
gst_caps_unref (capsb);
|
gst_caps_unref (capsb);
|
||||||
|
|
||||||
return va - vb;
|
if (va != vb)
|
||||||
|
return va - vb;
|
||||||
|
|
||||||
|
/* if otherwise the same, sort by stream-id */
|
||||||
|
ida = gst_pad_get_stream_id (GST_PAD_CAST (da));
|
||||||
|
idb = gst_pad_get_stream_id (GST_PAD_CAST (db));
|
||||||
|
ret = (ida) ? ((idb) ? strcmp (ida, idb) : -1) : 1;
|
||||||
|
g_free (ida);
|
||||||
|
g_free (idb);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
|
|
Loading…
Reference in a new issue