Commit 6e678528 authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

Use rc_max_rate in av_find_best_stream() if bitrate == 0.

Fixes ticket #2042.
parent 925f7980
......@@ -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) ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment