mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
mpegenc: simplify muxrate calculation
The fate-h264-bsf-mp4toannexb failures were caused by an integer overflow of the unneeded multiplication. Inspired by patch by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
f15f02c204
commit
af9240cd3c
@ -429,7 +429,7 @@ static int mpeg_mux_init(AVFormatContext *ctx)
|
|||||||
if (!s->mux_rate) {
|
if (!s->mux_rate) {
|
||||||
/* we increase slightly the bitrate to take into account the
|
/* we increase slightly the bitrate to take into account the
|
||||||
headers. XXX: compute it exactly */
|
headers. XXX: compute it exactly */
|
||||||
bitrate += bitrate*5/100;
|
bitrate += bitrate / 20;
|
||||||
bitrate += 10000;
|
bitrate += 10000;
|
||||||
s->mux_rate = (bitrate + (8 * 50) - 1) / (8 * 50);
|
s->mux_rate = (bitrate + (8 * 50) - 1) / (8 * 50);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user