From: Sebastian Dröge Date: Tue, 23 Feb 2016 16:19:18 +0000 (+0200) Subject: avdeinterlace: Don't assume that get_current_caps() returns non-NULL caps after has_c... X-Git-Tag: 1.19.3~499^2~377 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=20586e9f2d48e8bac3178172eec184b80cfca91e;p=platform%2Fupstream%2Fgstreamer.git avdeinterlace: Don't assume that get_current_caps() returns non-NULL caps after has_current_caps() Remove calls to gst_pad_has_current_caps() which then go on to call gst_pad_get_current_caps() as the caps can go to NULL in between. Instead just use gst_pad_get_current_caps() and check for NULL. https://bugzilla.gnome.org/show_bug.cgi?id=759539 --- diff --git a/ext/libav/gstavdeinterlace.c b/ext/libav/gstavdeinterlace.c index 1ffcb07..e3cfa8d 100644 --- a/ext/libav/gstavdeinterlace.c +++ b/ext/libav/gstavdeinterlace.c @@ -404,16 +404,15 @@ gst_ffmpegdeinterlace_chain (GstPad * pad, GstObject * parent, GST_OBJECT_LOCK (deinterlace); if (deinterlace->reconfigure) { + GstCaps *caps; + if ((gint) deinterlace->new_mode != -1) deinterlace->mode = deinterlace->new_mode; deinterlace->new_mode = -1; deinterlace->reconfigure = FALSE; GST_OBJECT_UNLOCK (deinterlace); - if (gst_pad_has_current_caps (deinterlace->srcpad)) { - GstCaps *caps; - - caps = gst_pad_get_current_caps (deinterlace->sinkpad); + if ((caps = gst_pad_get_current_caps (deinterlace->srcpad))) { gst_ffmpegdeinterlace_sink_setcaps (deinterlace->sinkpad, caps); gst_caps_unref (caps); }