aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-11-17 23:01:37 -0300
committerJames Almer <jamrial@gmail.com>2024-11-22 10:57:03 -0300
commit944212acad7c2254d9dc14764b29e0023aaa645a (patch)
treed90db46ad648c56877ab0a0da577ac659cf6e9c6
parent5813e5aa344b8c03c83bf62e729be0f447944ed1 (diff)
downloadffmpeg-944212acad7c2254d9dc14764b29e0023aaa645a.tar.gz
avformat/movenc: don't write a calculated avgBitrate when the provided one is unset
avgBitrate == 0 is used to signal a VBR track, so if that value is propagated by an encoder, don't overwrite it with a calculated value based on track size. Part of a fix for ticket #11303. Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavformat/movenc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index b6772ae548..0595c4ce82 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -737,6 +737,9 @@ static struct mpeg4_bit_rate_values calculate_mpeg4_bit_rates(MOVTrack *track)
// utilize values from properties if we have them available
if (props) {
+ // no avg_bitrate signals that the track is VBR
+ if (!props->avg_bitrate)
+ bit_rates.avg_bit_rate = props->avg_bitrate;
bit_rates.max_bit_rate = FFMAX(bit_rates.max_bit_rate,
props->max_bitrate);
bit_rates.buffer_size = props->buffer_size / 8;