Revert "baseparse: fix draining with less data than min frame size available"
authorSebastian Dröge <sebastian@centricular.com>
Wed, 2 Nov 2016 07:35:05 +0000 (09:35 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 2 Nov 2016 07:35:05 +0000 (09:35 +0200)
This reverts commit 2e278aeb7128e8732f5324ab8c8b22a47950c80a.

Some parsers, specifically audio parsers, assume to get all remaining
data on EOS and just pass them onwards. While the idea here is correct,
we will probably need a property for this on baseparse for parsers to
opt-in.

https://bugzilla.gnome.org/show_bug.cgi?id=773666

libs/gst/base/gstbaseparse.c

index 168b81b..816b7ab 100644 (file)
@@ -3184,17 +3184,9 @@ gst_base_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
     av = gst_adapter_available (parse->priv->adapter);
 
     if (G_UNLIKELY (parse->priv->drain)) {
-      GST_DEBUG_OBJECT (parse, "draining, data left: %u, min %u", av, min_size);
-      /* pass all available data to subclass, not just the minimum,
-       * but never pass less than the minimum required to the subclass */
-      if (av >= min_size) {
-        min_size = av;
-        if (G_UNLIKELY (!min_size))
-          goto done;
-      } else if (av > 0) {
-        GST_DEBUG_OBJECT (parse, "draining, but not enough data available, "
-            "discarding %u bytes", av);
-        gst_adapter_clear (parse->priv->adapter);
+      min_size = av;
+      GST_DEBUG_OBJECT (parse, "draining, data left: %d", min_size);
+      if (G_UNLIKELY (!min_size)) {
         goto done;
       }
     }