]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/metasound.c
Merge commit '9e7b62f0fb7462a902330fcc82cf596388f0187b'
[ffmpeg] / libavcodec / metasound.c
index cc221cceb24fa05e1b9591d7297418ad2672cba4..9cda3369048258e799d2507d844c933f7c35066d 100644 (file)
@@ -170,12 +170,6 @@ static int metasound_read_bitstream(AVCodecContext *avctx, TwinVQContext *tctx,
     GetBitContext gb;
     int i, j, k;
 
-    if (buf_size * 8 < avctx->bit_rate * mtab->size / avctx->sample_rate) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Frame too small (%d bytes). Truncated file?\n", buf_size);
-        return AVERROR(EINVAL);
-    }
-
     init_get_bits(&gb, buf, buf_size * 8);
 
     bits->window_type = get_bits(&gb, TWINVQ_WINDOW_TYPE_BITS);
@@ -323,6 +317,9 @@ static av_cold int metasound_decode_init(AVCodecContext *avctx)
         return AVERROR(ENOSYS);
     }
 
+    avctx->block_align = (avctx->bit_rate * tctx->mtab->size
+                                          / avctx->sample_rate + 7) / 8;
+
     tctx->codec          = TWINVQ_CODEC_METASOUND;
     tctx->read_bitstream = metasound_read_bitstream;
     tctx->dec_bark_env   = dec_bark_env;