]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dcadec.c
Merge commit '7bbc254d646ed9cf6deffc3fda75ae6729f95979'
[ffmpeg] / libavcodec / dcadec.c
index f8fa310c2fc0eff99c755b39c6c4aa5115301be5..0339eef34063bdbabee6dd3de2e3ef715e7030a1 100644 (file)
@@ -1038,7 +1038,7 @@ static int dca_filter_channels(DCAContext *s, int block_index, int upsample)
             unsigned i;
             /* Should apply the filter in Table 6-11 when upsampling. For
              * now, just duplicate. */
-            for (i = 511; i > 0; i--) {
+            for (i = 255; i > 0; i--) {
                 samples[2 * i]     =
                 samples[2 * i + 1] = samples[i];
             }
@@ -1472,7 +1472,6 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
     }
     // set AVCodec values with parsed data
     avctx->sample_rate = s->sample_rate;
-    avctx->bit_rate    = s->bit_rate;
 
     s->profile = FF_PROFILE_DTS;
 
@@ -1808,7 +1807,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
             /* If downmixing to stereo, don't decode additional channels.
              * FIXME: Using the xch_disable flag for this doesn't seem right. */
             if (!s->xch_disable)
-                channels += s->xll_channels - s->xll_residual_channels;
+                channels = s->xll_channels;
         }
     }
 
@@ -1937,6 +1936,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
     if (ret < 0)
         return ret;
 
+    if (   avctx->profile != FF_PROFILE_DTS_HD_MA
+        && avctx->profile != FF_PROFILE_DTS_HD_HRA)
+        avctx->bit_rate = s->bit_rate;
     *got_frame_ptr = 1;
 
     return buf_size;