Skip to content

Commit

Permalink
avcodec/alac: fix 20-bit support
Browse files Browse the repository at this point in the history
Signed-off-by: Paul B Mahol <[email protected]>
  • Loading branch information
richardpl committed May 5, 2016
1 parent f1560db commit c5d2d3d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libavcodec/alac.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,12 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
*outbuffer++ = alac->output_samples_buffer[ch][i];
}}
break;
case 20: {
for (ch = 0; ch < channels; ch++) {
for (i = 0; i < alac->nb_samples; i++)
alac->output_samples_buffer[ch][i] <<= 12;
}}
break;
case 24: {
for (ch = 0; ch < channels; ch++) {
for (i = 0; i < alac->nb_samples; i++)
Expand Down Expand Up @@ -556,6 +562,7 @@ static av_cold int alac_decode_init(AVCodecContext * avctx)
switch (alac->sample_size) {
case 16: avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
break;
case 20:
case 24:
case 32: avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
break;
Expand Down

0 comments on commit c5d2d3d

Please sign in to comment.