diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2012-03-18 13:36:32 -0700 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2012-03-18 15:25:25 -0700 |
commit | c346f6304c35e9dfffacc6c71a2b3dfd8913d90b (patch) | |
tree | f69735692e2f52ea17874ac8c44d1e5410a75979 /libavcodec | |
parent | 72ec043af4510723c53c729a67be482a14b7c7f3 (diff) |
adpcm: fix nb_samples rounding for adpcm_ima_dk3, and update reference.
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/adpcm.c | 2 | ||||
-rw-r--r-- | libavcodec/utils.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index 54c3e6d194..3610a58812 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -448,7 +448,7 @@ static int get_nb_samples(AVCodecContext *avctx, const uint8_t *buf, case CODEC_ID_ADPCM_IMA_DK3: if (avctx->block_align > 0) buf_size = FFMIN(buf_size, avctx->block_align); - nb_samples = ((buf_size - 16) * 8 / 3) / ch; + nb_samples = ((buf_size - 16) * 2 / 3 * 4) / ch; break; case CODEC_ID_ADPCM_IMA_DK4: nb_samples = 1 + (buf_size - 4 * ch) * 2 / ch; diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 20e9687c9b..fc48f029f6 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1859,7 +1859,7 @@ int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes) case CODEC_ID_ADPCM_IMA_WAV: return blocks * (1 + (ba - 4 * ch) / (4 * ch) * 8); case CODEC_ID_ADPCM_IMA_DK3: - return blocks * (((ba - 16) * 8 / 3) / ch); + return blocks * (((ba - 16) * 2 / 3 * 4) / ch); case CODEC_ID_ADPCM_IMA_DK4: return blocks * (1 + (ba - 4 * ch) * 2 / ch); case CODEC_ID_ADPCM_MS: |