diff vorbis_dec.c @ 7286:e267f2519248 libavcodec

float_to_int16_interleave: change src to an array of pointers instead of assuming it's contiguous. this has no immediate effect, but will allow it to be used in more codecs.
author lorenm
date Wed, 16 Jul 2008 00:50:12 +0000
parents 1fe3ae6a9491
children a4ebced5d4a2
line wrap: on
line diff
--- a/vorbis_dec.c	Tue Jul 15 23:04:28 2008 +0000
+++ b/vorbis_dec.c	Wed Jul 16 00:50:12 2008 +0000
@@ -1553,6 +1553,8 @@
 {
     vorbis_context *vc = avccontext->priv_data ;
     GetBitContext *gb = &(vc->gb);
+    const float *channel_ptrs[vc->audio_channels];
+    int i;
 
     int_fast16_t len;
 
@@ -1579,7 +1581,9 @@
 
     AV_DEBUG("parsed %d bytes %d bits, returned %d samples (*ch*bits) \n", get_bits_count(gb)/8, get_bits_count(gb)%8, len);
 
-    vc->dsp.float_to_int16_interleave(data, vc->channel_residues, len, vc->audio_channels);
+    for(i=0; i<vc->audio_channels; i++)
+        channel_ptrs[i] = vc->channel_residues+i*len;
+    vc->dsp.float_to_int16_interleave(data, channel_ptrs, len, vc->audio_channels);
     *data_size=len*2*vc->audio_channels;
 
     return buf_size ;