diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-06-22 13:59:19 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-06-22 14:16:58 +0200 |
commit | 99c3c3237bb56bead8f996874e5a283069713f07 (patch) | |
tree | 192cc66351083ff1a6d62d0be22d7863054424b9 /libavformat/utils.c | |
parent | 4fecb97fd36c2abab474bcf4e69f904e107812d2 (diff) | |
download | ffmpeg-99c3c3237bb56bead8f996874e5a283069713f07.tar.gz |
avformat/utils: Use internal->avctx for bitrate in estimate_timings_from_bit_rate() if needed
The internal avctx bitrate is copied into codecpar after estimate_timings()
Fixes Ticket5646
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index e2037db038..a3c6705353 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2568,6 +2568,8 @@ static void estimate_timings_from_bit_rate(AVFormatContext *ic) int64_t bit_rate = 0; for (i = 0; i < ic->nb_streams; i++) { st = ic->streams[i]; + if (st->codecpar->bit_rate <= 0 && st->internal->avctx->bit_rate > 0) + st->codecpar->bit_rate = st->internal->avctx->bit_rate; if (st->codecpar->bit_rate > 0) { if (INT64_MAX - st->codecpar->bit_rate < bit_rate) { bit_rate = 0; |