Browse code

avcodec/alac: fix 20-bit support

Signed-off-by: Paul B Mahol <onemda@gmail.com>

Paul B Mahol authored on 2016/05/06 01:13:28
Showing 1 changed files
... ...
@@ -391,6 +391,12 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
391 391
                 *outbuffer++ = alac->output_samples_buffer[ch][i];
392 392
         }}
393 393
         break;
394
+    case 20: {
395
+        for (ch = 0; ch < channels; ch++) {
396
+            for (i = 0; i < alac->nb_samples; i++)
397
+                alac->output_samples_buffer[ch][i] <<= 12;
398
+        }}
399
+        break;
394 400
     case 24: {
395 401
         for (ch = 0; ch < channels; ch++) {
396 402
             for (i = 0; i < alac->nb_samples; i++)
... ...
@@ -556,6 +562,7 @@ static av_cold int alac_decode_init(AVCodecContext * avctx)
556 556
     switch (alac->sample_size) {
557 557
     case 16: avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
558 558
              break;
559
+    case 20:
559 560
     case 24:
560 561
     case 32: avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
561 562
              break;