mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 16:08:51 +00:00
parsebin: fix critical when sorting pads
If the pad does not have a current caps, get_pad() returns the query caps which can be ANY. In such case the caps does not have any structure resulting in a critical warning when calling gst_caps_get_structure(). Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1254>
This commit is contained in:
parent
e6f39394f5
commit
1d833eba60
1 changed files with 47 additions and 30 deletions
|
@ -3336,15 +3336,31 @@ static gint
|
|||
sort_end_pads (GstParsePad * da, GstParsePad * db)
|
||||
{
|
||||
gint va, vb;
|
||||
GstCaps *capsa, *capsb;
|
||||
GstStructure *sa, *sb;
|
||||
const gchar *namea, *nameb;
|
||||
gchar *ida, *idb;
|
||||
gint ret;
|
||||
GstCaps *capsa, *capsb;
|
||||
|
||||
capsa = get_pad_caps (GST_PAD_CAST (da));
|
||||
capsb = get_pad_caps (GST_PAD_CAST (db));
|
||||
|
||||
if (gst_caps_get_size (capsa) == 0 || gst_caps_get_size (capsb) == 0) {
|
||||
if (gst_caps_is_any (capsa))
|
||||
va = 6;
|
||||
if (gst_caps_is_empty (capsa))
|
||||
va = 7;
|
||||
else
|
||||
va = 0;
|
||||
|
||||
if (gst_caps_is_any (capsb))
|
||||
vb = 6;
|
||||
if (gst_caps_is_empty (capsb))
|
||||
vb = 7;
|
||||
else
|
||||
vb = 0;
|
||||
} else {
|
||||
GstStructure *sa, *sb;
|
||||
|
||||
sa = gst_caps_get_structure ((const GstCaps *) capsa, 0);
|
||||
sb = gst_caps_get_structure ((const GstCaps *) capsb, 0);
|
||||
|
||||
|
@ -3376,6 +3392,7 @@ sort_end_pads (GstParsePad * da, GstParsePad * db)
|
|||
vb = 4;
|
||||
else
|
||||
vb = 5;
|
||||
}
|
||||
|
||||
gst_caps_unref (capsa);
|
||||
gst_caps_unref (capsb);
|
||||
|
|
Loading…
Reference in a new issue