[gstreamer-bugs] [Bug 617733] [wavparse] handle gst_pad_pull_range() returning less data than requested

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed May 26 05:39:30 PDT 2010


https://bugzilla.gnome.org/show_bug.cgi?id=617733
  GStreamer | gst-plugins-good | 0.10.21

Tim-Philipp Müller <t.i.m> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|                            |t.i.m at zen.co.uk
         Resolution|                            |FIXED
   Target Milestone|0.10.30                     |0.10.23
            Summary|wavparse: handle            |[wavparse] handle
                   |gst_pad_pull_range          |gst_pad_pull_range()
                   |returning less data than    |returning less data than
                   |requested                   |requested

--- Comment #9 from Tim-Philipp Müller <t.i.m at zen.co.uk> 2010-05-26 12:39:23 UTC ---
Ok, pushed:

commit 3462eed7e05fb4465ac86f4e8f3ed928a296fa6b
Author: Mark Nauwelaerts <mark.nauwelaerts at collabora.co.uk>
Date:   Tue May 25 15:34:11 2010 +0200

    wavparse: handle truncated input data at EOS in pull mode

    Fixes #617733.

diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c
index b7f6937..902edd7 100644
--- a/gst/wavparse/gstwavparse.c
+++ b/gst/wavparse/gstwavparse.c
@@ -1844,6 +1844,18 @@ iterate_adapter:
     if ((res = gst_pad_pull_range (wav->sinkpad, wav->offset,
                 desired, &buf)) != GST_FLOW_OK)
       goto pull_error;
+
+    /* we may get a short buffer at the end of the file */
+    if (GST_BUFFER_SIZE (buf) < desired) {
+      GST_LOG_OBJECT (wav, "Got only %u bytes of data", GST_BUFFER_SIZE
(buf));
+      if (GST_BUFFER_SIZE (buf) >= wav->blockalign) {
+        buf = gst_buffer_make_metadata_writable (buf);
+        GST_BUFFER_SIZE (buf) -= (GST_BUFFER_SIZE (buf) % wav->blockalign);
+      } else {
+        gst_buffer_unref (buf);
+        goto found_eos;
+      }
+    }
   }

Reflowed this a little though (to fix debug message, and avoid using 'desired'
as temp variable here).

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.



More information about the Gstreamer-bugs mailing list