Commit 49f46319 authored by Sebastian Dröge's avatar Sebastian Dröge

gst: Handle gst_pad_get_current_caps() returning NULL gracefully

parent 9b2e1f9f
...@@ -479,6 +479,9 @@ gst_dvdec_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) ...@@ -479,6 +479,9 @@ gst_dvdec_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
GstCaps *caps; GstCaps *caps;
caps = gst_pad_get_current_caps (dvdec->srcpad); caps = gst_pad_get_current_caps (dvdec->srcpad);
if (!caps)
goto not_negotiated;
gst_dvdec_negotiate_pool (dvdec, caps, &dvdec->vinfo); gst_dvdec_negotiate_pool (dvdec, caps, &dvdec->vinfo);
gst_caps_unref (caps); gst_caps_unref (caps);
} }
......
...@@ -228,6 +228,8 @@ gst_gdk_pixbuf_dec_setup_pool (GstGdkPixbufDec * filter, GstVideoInfo * info) ...@@ -228,6 +228,8 @@ gst_gdk_pixbuf_dec_setup_pool (GstGdkPixbufDec * filter, GstVideoInfo * info)
guint size, min, max; guint size, min, max;
target = gst_pad_get_current_caps (filter->srcpad); target = gst_pad_get_current_caps (filter->srcpad);
if (!target)
return FALSE;
/* try to get a bufferpool now */ /* try to get a bufferpool now */
/* find a pool for the negotiated caps now */ /* find a pool for the negotiated caps now */
......
...@@ -1546,8 +1546,9 @@ restart: ...@@ -1546,8 +1546,9 @@ restart:
/* setcaps on sink and src pads */ /* setcaps on sink and src pads */
sinkcaps = gst_pad_get_current_caps (self->sinkpad); sinkcaps = gst_pad_get_current_caps (self->sinkpad);
if (!gst_deinterlace_setcaps (self, self->sinkpad, sinkcaps)) { if (!sinkcaps || !gst_deinterlace_setcaps (self, self->sinkpad, sinkcaps)) {
gst_caps_unref (sinkcaps); if (sinkcaps)
gst_caps_unref (sinkcaps);
return GST_FLOW_NOT_NEGOTIATED; return GST_FLOW_NOT_NEGOTIATED;
} }
......
...@@ -559,8 +559,10 @@ input_formats_do_not_match: ...@@ -559,8 +559,10 @@ input_formats_do_not_match:
GST_ELEMENT_ERROR (smpte, CORE, NEGOTIATION, (NULL), GST_ELEMENT_ERROR (smpte, CORE, NEGOTIATION, (NULL),
("input formats don't match: %" GST_PTR_FORMAT " vs. %" GST_PTR_FORMAT, ("input formats don't match: %" GST_PTR_FORMAT " vs. %" GST_PTR_FORMAT,
caps1, caps2)); caps1, caps2));
gst_caps_unref (caps1); if (caps1)
gst_caps_unref (caps2); gst_caps_unref (caps1);
if (caps2)
gst_caps_unref (caps2);
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment