mirror of https://git.ffmpeg.org/ffmpeg.git
alacdec: fix packed sample output with 5.1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
3800facac6
commit
17352ad315
|
@ -440,23 +440,29 @@ static int decode_element(AVCodecContext *avctx, void *data, int ch_index,
|
||||||
switch(alac->sample_size) {
|
switch(alac->sample_size) {
|
||||||
case 16: {
|
case 16: {
|
||||||
int16_t *outbuffer = ((int16_t *)alac->frame.extended_data[0]) + ch_index;
|
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++)
|
for (ch = 0; ch < channels; ch++)
|
||||||
*outbuffer++ = alac->output_samples_buffer[ch][i];
|
*outbuffer++ = alac->output_samples_buffer[ch][i];
|
||||||
|
outbuffer += alac->channels - channels;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 24: {
|
case 24: {
|
||||||
int32_t *outbuffer = ((int32_t *)alac->frame.extended_data[0]) + ch_index;
|
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++)
|
for (ch = 0; ch < channels; ch++)
|
||||||
*outbuffer++ = alac->output_samples_buffer[ch][i] << 8;
|
*outbuffer++ = alac->output_samples_buffer[ch][i] << 8;
|
||||||
|
outbuffer += alac->channels - channels;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 32: {
|
case 32: {
|
||||||
int32_t *outbuffer = ((int32_t *)alac->frame.extended_data[0]) + ch_index;
|
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++)
|
for (ch = 0; ch < channels; ch++)
|
||||||
*outbuffer++ = alac->output_samples_buffer[ch][i];
|
*outbuffer++ = alac->output_samples_buffer[ch][i];
|
||||||
|
outbuffer += alac->channels - channels;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue