1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

alacdec: fix packed sample output with 5.1

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-07-21 06:39:01 +02:00
parent 3800facac6
commit 17352ad315

View File

@ -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;
}