decodebin: Only continue autoplugging once the pad has final caps

If the caps query returned us fixed caps this doesn't mean yet
that these caps are actually complete (fields might be missing).

It allows to do us some decisions, but the selection of the next
element should be delayed as only complete caps allow proper selection
of the next element.
This commit is contained in:
Sebastian Dröge 2014-07-10 12:17:52 +02:00
parent 424ff91394
commit f66555668a

View file

@ -1577,8 +1577,16 @@ analyze_new_pad (GstDecodeBin * dbin, GstElement * src, GstPad * pad,
/* 1.c when the caps are not fixed yet, we can't be sure what element to /* 1.c when the caps are not fixed yet, we can't be sure what element to
* connect. We delay autoplugging until the caps are fixed */ * connect. We delay autoplugging until the caps are fixed */
if (!is_parser_converter && !gst_caps_is_fixed (caps)) if (!is_parser_converter && !gst_caps_is_fixed (caps)) {
goto non_fixed; goto non_fixed;
} else if (!is_parser_converter) {
gst_caps_unref (caps);
caps = gst_pad_get_current_caps (pad);
if (!caps) {
GST_DEBUG_OBJECT (dbin, "No final caps set yet, delaying autoplugging");
goto setup_caps_delay;
}
}
/* 1.d else get the factories and if there's no compatible factory goto /* 1.d else get the factories and if there's no compatible factory goto
* unknown_type */ * unknown_type */
@ -1734,11 +1742,11 @@ analyze_new_pad (GstDecodeBin * dbin, GstElement * src, GstPad * pad,
pad = p; pad = p;
gst_caps_unref (caps); gst_caps_unref (caps);
caps = get_pad_caps (pad);
if (!gst_caps_is_fixed (caps)) { caps = gst_pad_get_current_caps (pad);
g_value_array_free (factories); if (!caps) {
goto non_fixed; GST_DEBUG_OBJECT (dbin, "No final caps set yet, delaying autoplugging");
goto setup_caps_delay;
} }
} }