diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-05-31 13:25:31 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-05-31 13:41:10 +0200 |
commit | 6e67852881e4c8c3ef80dd6c3142c286bee6e272 (patch) | |
tree | 44436bcb2ac5908e50c05f063d8545ba50fd6bd8 /libavformat/utils.c | |
parent | 925f7980eb29267d4a491e7a47e93aed6f541d75 (diff) |
Use rc_max_rate in av_find_best_stream() if bitrate == 0.
Fixes ticket #2042.
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 d8f136386a..1f722410b2 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3559,6 +3559,8 @@ int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type, } count = st->codec_info_nb_frames; bitrate = avctx->bit_rate; + if (!bitrate) + bitrate = avctx->rc_max_rate; multiframe = FFMIN(5, count); if ((best_multiframe > multiframe) || (best_multiframe == multiframe && best_bitrate > bitrate) || |