summaryrefslogtreecommitdiff
path: root/libavcodec/alac.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2016-05-05 18:13:28 +0200
committerPaul B Mahol <onemda@gmail.com>2016-05-05 18:15:22 +0200
commitc5d2d3dced64fd4fc1a5f982315fb5dbd9101d44 (patch)
tree3ef1bd0cf657b1559b1daf9cd14e4c2c836285d5 /libavcodec/alac.c
parentf1560dbb2a0089d63ca61a324673f7e2e30fb517 (diff)
avcodec/alac: fix 20-bit support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/alac.c')
-rw-r--r--libavcodec/alac.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index fc8bc9682d..548f5bdce5 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -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++)
@@ -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;