mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
autoconvert: Use gst_pad_peer_accept_caps instead of gst_pad_set_caps.
gst_pad_set_caps on the internal source pad always succeeds, because caps propagate to the peer with buffers, not immediately. Using gst_pad_peer_accept_caps properly checks whether the actual sub-element can accept caps when they change. https://bugzilla.gnome.org/show_bug.cgi?id=575568
This commit is contained in:
parent
68621dfa56
commit
0fcf8001b1
1 changed files with 2 additions and 2 deletions
|
@ -692,7 +692,7 @@ gst_auto_convert_sink_setcaps (GstPad * pad, GstCaps * caps)
|
||||||
|
|
||||||
subelement = gst_auto_convert_get_subelement (autoconvert);
|
subelement = gst_auto_convert_get_subelement (autoconvert);
|
||||||
if (subelement) {
|
if (subelement) {
|
||||||
if (gst_pad_set_caps (autoconvert->current_internal_srcpad, caps)) {
|
if (gst_pad_peer_accept_caps (autoconvert->current_internal_srcpad, caps)) {
|
||||||
/* If we can set the new caps on the current element,
|
/* If we can set the new caps on the current element,
|
||||||
* then we just get out
|
* then we just get out
|
||||||
*/
|
*/
|
||||||
|
@ -777,7 +777,7 @@ gst_auto_convert_sink_setcaps (GstPad * pad, GstCaps * caps)
|
||||||
internal_sinkpad_quark);
|
internal_sinkpad_quark);
|
||||||
|
|
||||||
/* Now we check if the element can really accept said caps */
|
/* Now we check if the element can really accept said caps */
|
||||||
if (!gst_pad_set_caps (internal_srcpad, caps)) {
|
if (!gst_pad_peer_accept_caps (internal_srcpad, caps)) {
|
||||||
GST_DEBUG_OBJECT (autoconvert, "Could not set %s:%s to %" GST_PTR_FORMAT,
|
GST_DEBUG_OBJECT (autoconvert, "Could not set %s:%s to %" GST_PTR_FORMAT,
|
||||||
GST_DEBUG_PAD_NAME (internal_srcpad), caps);
|
GST_DEBUG_PAD_NAME (internal_srcpad), caps);
|
||||||
goto next_element;
|
goto next_element;
|
||||||
|
|
Loading…
Reference in a new issue