From: Wim Taymans Date: Fri, 2 Dec 2005 10:47:55 +0000 (+0000) Subject: ext/vorbis/vorbisdec.c: Small cleanups. X-Git-Tag: 1.19.3~511^2~12390 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bd713d06ed2fd7739ef4da1fd9c55d40aec25a6e;p=platform%2Fupstream%2Fgstreamer.git ext/vorbis/vorbisdec.c: Small cleanups. Original commit message from CVS: * ext/vorbis/vorbisdec.c: (vorbis_handle_data_packet): Small cleanups. --- diff --git a/ChangeLog b/ChangeLog index 09c01ea..da8fbdf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2005-12-02 Wim Taymans + * ext/vorbis/vorbisdec.c: (vorbis_handle_data_packet): + Small cleanups. + +2005-12-02 Wim Taymans + * gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_transform): Post errors. diff --git a/ext/vorbis/vorbisdec.c b/ext/vorbis/vorbisdec.c index 769a1c6..61b2a21 100644 --- a/ext/vorbis/vorbisdec.c +++ b/ext/vorbis/vorbisdec.c @@ -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;