Skip to content

Commit

Permalink
adpcmenc: Set bits_per_coded_sample
Browse files Browse the repository at this point in the history
  • Loading branch information
justinruggles committed Sep 24, 2011
1 parent b304244 commit 9ff6d07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libavcodec/adpcmenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9ff6d07

Please sign in to comment.