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
This commit is contained in:
Sebastian Dröge 2016-02-23 18:19:18 +02:00
parent 4930a1f461
commit 20586e9f2d

View file

@ -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);
}