baseparse: check for remaining data when draining in push mode
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Fri, 18 Dec 2009 12:30:29 +0000 (13:30 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 8 Apr 2011 17:07:02 +0000 (18:07 +0100)
gst/audioparsers/gstbaseparse.c

index bfbb73dab1152f7feaaf0fbd34e7a5734cccf7c2..dfe53d5488a9bb598d132e63293fd28b05ae1dff 100644 (file)
@@ -1103,6 +1103,11 @@ gst_base_parse_chain (GstPad * pad, GstBuffer * buffer)
 
       if (G_UNLIKELY (parse->priv->drain)) {
         min_size = gst_adapter_available (parse->adapter);
+        GST_DEBUG_OBJECT (parse, "draining, data left: %d", min_size);
+        if (G_UNLIKELY (!min_size)) {
+          gst_buffer_unref (tmpbuf);
+          goto done;
+        }
       }
 
       /* Collect at least min_frame_size bytes */