pngenc: ensure setcaps was called before chain function

This is needed to properly error out for e.g. "fakesrc ! pngenc ! fakesink".
This commit is contained in:
René Stadler 2011-10-16 20:05:28 +02:00 committed by René Stadler
parent 7e390c4635
commit 65f9354803

View file

@ -271,6 +271,11 @@ gst_pngenc_chain (GstPad * pad, GstBuffer * buf)
GST_DEBUG_OBJECT (pngenc, "BEGINNING"); GST_DEBUG_OBJECT (pngenc, "BEGINNING");
if (G_UNLIKELY (pngenc->width <= 0 || pngenc->height <= 0)) {
ret = GST_FLOW_NOT_NEGOTIATED;
goto done;
}
if (G_UNLIKELY (GST_BUFFER_SIZE (buf) < pngenc->height * pngenc->stride)) { if (G_UNLIKELY (GST_BUFFER_SIZE (buf) < pngenc->height * pngenc->stride)) {
gst_buffer_unref (buf); gst_buffer_unref (buf);
GST_ELEMENT_ERROR (pngenc, STREAM, FORMAT, (NULL), GST_ELEMENT_ERROR (pngenc, STREAM, FORMAT, (NULL),