[FFmpeg-cvslog] alacdec: fix packed sample output with 5.1

Michael Niedermayer git at videolan.org
Sat Jul 21 06:43:23 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jul 21 06:39:01 2012 +0200| [17352ad3155a64683613c8086f558599445aa3c7] | committer: Michael Niedermayer

alacdec: fix packed sample output with 5.1

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=17352ad3155a64683613c8086f558599445aa3c7
---

 libavcodec/alac.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index f146238..4fa3285 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -440,23 +440,29 @@ static int decode_element(AVCodecContext *avctx, void *data, int ch_index,
         switch(alac->sample_size) {
         case 16: {
             int16_t *outbuffer = ((int16_t *)alac->frame.extended_data[0]) + ch_index;
-            for (i = 0; i < alac->nb_samples; i++)
+            for (i = 0; i < alac->nb_samples; i++) {
                 for (ch = 0; ch < channels; ch++)
                     *outbuffer++ = alac->output_samples_buffer[ch][i];
+                outbuffer += alac->channels - channels;
+            }
             }
             break;
         case 24: {
             int32_t *outbuffer = ((int32_t *)alac->frame.extended_data[0]) + ch_index;
-            for (i = 0; i < alac->nb_samples; i++)
+            for (i = 0; i < alac->nb_samples; i++) {
                 for (ch = 0; ch < channels; ch++)
                     *outbuffer++ = alac->output_samples_buffer[ch][i] << 8;
+                outbuffer += alac->channels - channels;
+            }
             }
             break;
         case 32: {
             int32_t *outbuffer = ((int32_t *)alac->frame.extended_data[0]) + ch_index;
-            for (i = 0; i < alac->nb_samples; i++)
+            for (i = 0; i < alac->nb_samples; i++) {
                 for (ch = 0; ch < channels; ch++)
                     *outbuffer++ = alac->output_samples_buffer[ch][i];
+                outbuffer += alac->channels - channels;
+            }
             }
             break;
         }



More information about the ffmpeg-cvslog mailing list