gst: Handle gst_pad_get_current_caps() returning NULL gracefully
This commit is contained in:
parent
9b2e1f9f36
commit
49f4631909
@ -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)
|
|||||||
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,7 +1546,8 @@ 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)) {
|
||||||
|
if (sinkcaps)
|
||||||
gst_caps_unref (sinkcaps);
|
gst_caps_unref (sinkcaps);
|
||||||
return GST_FLOW_NOT_NEGOTIATED;
|
return GST_FLOW_NOT_NEGOTIATED;
|
||||||
}
|
}
|
||||||
|
@ -559,7 +559,9 @@ 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));
|
||||||
|
if (caps1)
|
||||||
gst_caps_unref (caps1);
|
gst_caps_unref (caps1);
|
||||||
|
if (caps2)
|
||||||
gst_caps_unref (caps2);
|
gst_caps_unref (caps2);
|
||||||
return GST_FLOW_ERROR;
|
return GST_FLOW_ERROR;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user