From 5cd94e7afc5f0d81b965a4f0d53cd40bed02f658 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Fri, 12 Jan 2007 18:06:29 +0000 Subject: [PATCH] libs/gst/base/gstbasesink.c (gst_base_sink_negotiate_pull): Don't set_caps() if the result of fixating is ANY, as it'... Original commit message from CVS: 2007-01-12 Andy Wingo * libs/gst/base/gstbasesink.c (gst_base_sink_negotiate_pull): Don't set_caps() if the result of fixating is ANY, as it's not supported, and not necessary in the case of a link with no template caps on either side. Fixes tests/check/libs/basesrc in some pull-mode tests. --- ChangeLog | 6 ++++++ libs/gst/base/gstbasesink.c | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 276f951815..9e115a025a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2007-01-12 Andy Wingo + * libs/gst/base/gstbasesink.c (gst_base_sink_negotiate_pull): + Don't set_caps() if the result of fixating is ANY, as it's not + supported, and not necessary in the case of a link with no + template caps on either side. Fixes tests/check/libs/basesrc in + some pull-mode tests. + * libs/gst/base/gstbasetransform.c (_GstBaseTransformPrivate): (gst_base_transform_init, gst_base_transform_sink_activate_push) (gst_base_transform_src_activate_pull): diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index 8f0d411480..b829f66109 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -2251,8 +2251,15 @@ gst_base_sink_negotiate_pull (GstBaseSink * basesink) caps = gst_caps_make_writable (caps); gst_pad_fixate_caps (pad, caps); - if (!gst_pad_set_caps (pad, caps)) - goto could_not_set_caps; + if (gst_caps_is_any (caps)) { + GST_DEBUG_OBJECT (basesink, "caps were ANY after fixating, " + "allowing pull()"); + /* neither side has template caps in this case, so they are prepared for + pull() without setcaps() */ + } else { + if (!gst_pad_set_caps (pad, caps)) + goto could_not_set_caps; + } gst_caps_unref (caps); gst_object_unref (pad);