]> git.sesse.net Git - ffmpeg/commitdiff
adpcmenc: Set bits_per_coded_sample
authorJustin Ruggles <justin.ruggles@gmail.com>
Thu, 8 Sep 2011 02:52:06 +0000 (22:52 -0400)
committerJustin Ruggles <justin.ruggles@gmail.com>
Sat, 24 Sep 2011 00:54:29 +0000 (20:54 -0400)
libavcodec/adpcmenc.c
libavcodec/utils.c

index 6295eedc55c064f910ddbb3c108e09e44005e8d2..2a117f4aaeae0395d8f0247d0b6a52a4aca48c4c 100644 (file)
@@ -86,6 +86,8 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx)
         FF_ALLOC_OR_GOTO(avctx, s->trellis_hash, 65536 * sizeof(*s->trellis_hash), error);
     }
 
+    avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
+
     switch(avctx->codec->id) {
     case CODEC_ID_ADPCM_IMA_WAV:
         avctx->frame_size = (BLKSIZE - 4 * avctx->channels) * 8 / (4 * avctx->channels) + 1; /* each 16 bits sample gives one nibble */
index 9f198cb32aa6bc9fedb5ed88bcd93dce41745c27..8459e5f8705397896686bc206891dbb0c19429d2 100644 (file)
@@ -1121,6 +1121,8 @@ int av_get_bits_per_sample(enum CodecID codec_id){
     case CODEC_ID_ADPCM_SBPRO_4:
     case CODEC_ID_ADPCM_CT:
     case CODEC_ID_ADPCM_IMA_WAV:
+    case CODEC_ID_ADPCM_IMA_QT:
+    case CODEC_ID_ADPCM_SWF:
     case CODEC_ID_ADPCM_MS:
     case CODEC_ID_ADPCM_YAMAHA:
         return 4;