diff mbox series

[FFmpeg-devel,5/5] avformat/movenc: simplify ISML manifest bit rate setting

Message ID 20200920170629.26504-6-jeebjp@gmail.com
State New
Headers show
Series avformat/movenc: btrt box support
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Jan Ekström Sept. 20, 2020, 5:06 p.m. UTC
The newly calculated average bit rate value is pretty much what is
being done here.
---
 libavformat/movenc.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

Comments

Martin Storsjö Sept. 21, 2020, 10:14 a.m. UTC | #1
On Sun, 20 Sep 2020, Jan Ekström wrote:

> The newly calculated average bit rate value is pretty much what is
> being done here.
> ---
> libavformat/movenc.c | 13 +++----------
> 1 file changed, 3 insertions(+), 10 deletions(-)

Ok

// Martin
diff mbox series

Patch

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 0f14e255e9..35d028e6de 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4200,7 +4200,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,
@@ -4243,15 +4242,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");