[FFmpeg-cvslog] avformat/movenc: simplify ISML manifest bit rate logic

Jan Ekström git at videolan.org
Tue Sep 22 18:34:42 EEST 2020


ffmpeg | branch: master | Jan Ekström <jeebjp at gmail.com> | Sun Sep 20 19:55:14 2020 +0300| [519bd469d01af1727f943e5b73c964c94f29ccd0] | committer: Jan Ekström

avformat/movenc: simplify ISML manifest bit rate logic

The newly calculated average bit rate value is pretty much what is
being done here.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=519bd469d01af1727f943e5b73c964c94f29ccd0
---

 libavformat/movenc.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 860e331b19..20768cd45f 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4209,7 +4209,6 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat
 {
     int64_t pos = avio_tell(pb);
     int i;
-    int64_t manifest_bit_rate = 0;
 
     static const uint8_t uuid[] = {
         0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd,
@@ -4252,15 +4251,9 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat
             continue;
         }
 
-        if (track->par->bit_rate) {
-            manifest_bit_rate = track->par->bit_rate;
-        } else {
-            manifest_bit_rate = bit_rates.max_bit_rate;
-        }
-
-        avio_printf(pb, "<%s systemBitrate=\"%"PRId64"\">\n", type,
-                    manifest_bit_rate);
-        param_write_int(pb, "systemBitrate", manifest_bit_rate);
+        avio_printf(pb, "<%s systemBitrate=\"%"PRIu32"\">\n", type,
+                    bit_rates.avg_bit_rate);
+        param_write_int(pb, "systemBitrate", bit_rates.avg_bit_rate);
         param_write_int(pb, "trackID", track_id);
         param_write_string(pb, "systemLanguage", lang ? lang->value : "und");
 



More information about the ffmpeg-cvslog mailing list