[FFmpeg-cvslog] adpcmenc: Set bits_per_coded_sample

Justin Ruggles git at videolan.org
Sat Sep 24 22:46:39 CEST 2011


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Wed Sep  7 22:52:06 2011 -0400| [9ff6d0791b220d80844b45c9217113306a50a6cc] | committer: Justin Ruggles

adpcmenc: Set bits_per_coded_sample

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9ff6d0791b220d80844b45c9217113306a50a6cc
---

 libavcodec/adpcmenc.c |    2 ++
 libavcodec/utils.c    |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c
index 6295eed..2a117f4 100644
--- a/libavcodec/adpcmenc.c
+++ b/libavcodec/adpcmenc.c
@@ -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 */
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 9f198cb..8459e5f 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -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;



More information about the ffmpeg-cvslog mailing list