From 9bd75f89b78f30828ec0c18d76d9bea91430c43a Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Mon, 10 Nov 2003 13:56:25 +0000 Subject: [PATCH] Two fixes. The first sets inited to TRUE when we're going into passthrough mode (else, capsnego succeeds and the chai... Original commit message from CVS: Two fixes. The first sets inited to TRUE when we're going into passthrough mode (else, capsnego succeeds and the chain() function warns that inited != TRUE), and the second check for validity of caps on src side that were entered on sink side before applying. Else, caps1 could be NULL which causes a segfault. --- gst/videoscale/gstvideoscale.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gst/videoscale/gstvideoscale.c b/gst/videoscale/gstvideoscale.c index fee0f8b..9cdc3d4 100644 --- a/gst/videoscale/gstvideoscale.c +++ b/gst/videoscale/gstvideoscale.c @@ -330,6 +330,7 @@ gst_videoscale_sink_link (GstPad *pad, GstCaps *caps) ret = gst_pad_try_set_caps (videoscale->srcpad, gst_caps_copy(caps)); if (ret == GST_PAD_LINK_OK || ret == GST_PAD_LINK_DONE) { videoscale->passthru = TRUE; + videoscale->inited = TRUE; return ret; } @@ -342,6 +343,12 @@ gst_videoscale_sink_link (GstPad *pad, GstCaps *caps) peercaps = gst_pad_get_allowed_caps(videoscale->srcpad); caps1 = gst_caps_intersect(peercaps, srccaps); + if (!caps1) { + /* apparently, the sink element doesn't like the input of the + * source element. The user should add a colorspace converter + * or so. */ + return GST_PAD_LINK_REFUSED; + } if (!GST_CAPS_IS_FIXED (caps1)) { /* FIXME */ -- 2.7.4