ext/vorbis/vorbisdec.c: Small cleanups.
authorWim Taymans <wim.taymans@gmail.com>
Fri, 2 Dec 2005 10:47:55 +0000 (10:47 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Fri, 2 Dec 2005 10:47:55 +0000 (10:47 +0000)
Original commit message from CVS:
* ext/vorbis/vorbisdec.c: (vorbis_handle_data_packet):
Small cleanups.

ChangeLog
ext/vorbis/vorbisdec.c

index 09c01ea..da8fbdf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2005-12-02  Wim Taymans  <wim@fluendo.com>
 
+       * ext/vorbis/vorbisdec.c: (vorbis_handle_data_packet):
+       Small cleanups.
+
+2005-12-02  Wim Taymans  <wim@fluendo.com>
+
        * gst/audioconvert/gstaudioconvert.c:
        (gst_audio_convert_transform):
        Post errors.
index 769a1c6..61b2a21 100644 (file)
@@ -749,6 +749,7 @@ vorbis_handle_data_packet (GstVorbisDec * vd, ogg_packet * packet)
   guint sample_count;
   GstBuffer *out;
   GstFlowReturn result;
+  gint size;
 
   if (!vd->initialized)
     goto not_initialized;
@@ -767,10 +768,11 @@ vorbis_handle_data_packet (GstVorbisDec * vd, ogg_packet * packet)
   if ((sample_count = vorbis_synthesis_pcmout (&vd->vd, NULL)) == 0)
     goto done;
 
+  size = sample_count * vd->vi.channels * sizeof (float);
+
   /* alloc buffer for it */
   result = gst_pad_alloc_buffer (vd->srcpad, GST_BUFFER_OFFSET_NONE,
-      sample_count * vd->vi.channels * sizeof (float),
-      GST_PAD_CAPS (vd->srcpad), &out);
+      size, GST_PAD_CAPS (vd->srcpad), &out);
   if (result != GST_FLOW_OK)
     goto done;
 
@@ -782,6 +784,7 @@ vorbis_handle_data_packet (GstVorbisDec * vd, ogg_packet * packet)
   copy_samples ((float *) GST_BUFFER_DATA (out), pcm, sample_count,
       vd->vi.channels);
 
+  GST_BUFFER_SIZE (out) = size;
   GST_BUFFER_OFFSET (out) = vd->granulepos;
   if (vd->granulepos != -1) {
     GST_BUFFER_OFFSET_END (out) = vd->granulepos + sample_count;