From 2f8afa859677519afcb88bb22302c13378e22da9 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 23 Nov 2002 18:21:17 +0000 Subject: [PATCH] Don't error when the peer srcpad is not usable Original commit message from CVS: Don't error when the peer srcpad is not usable --- ext/mpeg2dec/gstmpeg2deccvs.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ext/mpeg2dec/gstmpeg2deccvs.c b/ext/mpeg2dec/gstmpeg2deccvs.c index 1714d790ee..a9aea62abb 100644 --- a/ext/mpeg2dec/gstmpeg2deccvs.c +++ b/ext/mpeg2dec/gstmpeg2deccvs.c @@ -252,6 +252,14 @@ gst_mpeg2dec_negotiate_format (GstMpeg2dec *mpeg2dec) /* we what we are allowed to do */ allowed = gst_pad_get_allowed_caps (mpeg2dec->srcpad); + /* we could not get allowed caps */ + if (!allowed) { + allowed = GST_CAPS_NEW ( + "mpeg2dec_negotiate", + "video/raw", + "format", GST_PROPS_FOURCC (GST_STR_FOURCC ("I420")) + ); + } /* try to fix our height */ trylist = gst_caps_intersect (allowed, @@ -435,7 +443,8 @@ gst_mpeg2dec_chain (GstPad *pad, GstBuffer *buf) (mpeg2dec->first && !GST_BUFFER_FLAG_IS_SET (outbuf, GST_BUFFER_KEY_UNIT))) { */ - if (picture->flags & PIC_FLAG_SKIP) { + if (picture->flags & PIC_FLAG_SKIP || + !GST_PAD_IS_USABLE (mpeg2dec->srcpad)) { gst_buffer_unref (outbuf); } else {