Move WMA case from ff_get_audio_frame_size() to av_get_audio_frame_duration()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-08-14 02:42:14 +02:00
parent ed488d1535
commit 7b59217b60
2 changed files with 8 additions and 6 deletions

View file

@ -722,12 +722,7 @@ int ff_get_audio_frame_size(AVCodecContext *enc, int size, int mux)
if ((frame_size = av_get_audio_frame_duration(enc, size)) > 0)
return frame_size;
//For WMA we currently have no other means to calculate duration thus we
//do it here by assuming CBR, which is true for all known cases.
if (!mux && enc->bit_rate>0 && size>0 && enc->sample_rate>0 && enc->block_align>1) {
if (enc->codec_id == AV_CODEC_ID_WMAV1 || enc->codec_id == AV_CODEC_ID_WMAV2)
return ((int64_t)size * 8 * enc->sample_rate) / enc->bit_rate;
}
return -1;
}