diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-07-21 08:39:01 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-07-21 08:39:01 +0400 |
commit | 17352ad3155a64683613c8086f558599445aa3c7 (patch) | |
tree | b3c6adb5657ccb1eae9eb0be24640efc2b01cf41 /libavcodec/alac.c | |
parent | 3800facac692bf6b255bb2859a338334b0b692fe (diff) |
alacdec: fix packed sample output with 5.1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/alac.c')
-rw-r--r-- | libavcodec/alac.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c index f146238327..4fa328539c 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; } |