diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-04 04:06:49 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-04 04:27:01 +0100 |
commit | 337fa0dbe7b12977ba11d0ba0e6088daa6917453 (patch) | |
tree | 1eaa35a55aa54b1bbf63b001220f138f86e7b84e /libavformat/utils.c | |
parent | b8afbbca9c4e96881e8e22018c675ed5b915fea6 (diff) | |
download | ffmpeg-337fa0dbe7b12977ba11d0ba0e6088daa6917453.tar.gz |
lavf: Do not compute the packet duration based on the bitrate if the frame_size can be determined.
This fixes issues when the bitrate is variable or inaccurate but the
frame size has not been determined yet.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index bf8abeec68..dce34449ba 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -779,7 +779,7 @@ static int get_audio_frame_size(AVCodecContext *enc, int size) frame_size = (size << 3) / (bits_per_sample * enc->channels); } else { /* used for example by ADPCM codecs */ - if (enc->bit_rate == 0) + if (enc->bit_rate == 0 || determinable_frame_size(enc)) return -1; frame_size = ((int64_t)size * 8 * enc->sample_rate) / enc->bit_rate; } |