jpegdec: fix bogus warning about discont flag on first buffer
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Tue, 13 Oct 2009 00:02:15 +0000 (01:02 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Tue, 13 Oct 2009 00:10:59 +0000 (01:10 +0100)
The very first buffer should always have the DISCONT flag set, no
need to warn about that. Only warn if we get a DISCONT buffer in
non-packetised mode and we already have some data.

ext/jpeg/gstjpegdec.c

index e95535a..66d73dc 100644 (file)
@@ -902,7 +902,7 @@ gst_jpeg_dec_chain (GstPad * pad, GstBuffer * buf)
   if (GST_BUFFER_IS_DISCONT (buf)) {
     GST_DEBUG_OBJECT (dec, "buffer has DISCONT flag set");
     dec->discont = TRUE;
-    if (!dec->packetized) {
+    if (!dec->packetized && dec->tempbuf != NULL) {
       GST_WARNING_OBJECT (dec, "DISCONT buffer in non-packetized mode, bad");
       gst_buffer_replace (&dec->tempbuf, NULL);
     }