diff --git a/gst/pnm/gstpnmenc.c b/gst/pnm/gstpnmenc.c index a47e6055e9..9c908a4514 100644 --- a/gst/pnm/gstpnmenc.c +++ b/gst/pnm/gstpnmenc.c @@ -112,10 +112,9 @@ gst_pnmenc_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) GstBuffer *out; - if ((s->info.width == 0) || (s->info.height == 0) || (s->info.fields == 0)) { - r = GST_FLOW_ERROR; - goto out; - } + if (s->info.width == 0 || s->info.height == 0 || s->info.fields == 0) + goto not_negotiated; + /* Assumption: One buffer, one image. That is, always first write header. */ header = g_strdup_printf ("P%i\n%i %i\n%i\n", s->info.type + 3 * (1 - s->info.encoding), s->info.width, s->info.height, @@ -182,6 +181,12 @@ gst_pnmenc_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) out: return r; + +not_negotiated: + { + gst_buffer_unref (buf); + return GST_FLOW_NOT_NEGOTIATED; + } } static gboolean