diff mbox series

[FFmpeg-devel,2/5] avformat/movenc: utilize the maximum bit rate in ISML writing

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

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
This way we have a single location in movenc which utilizes the
CPB properties.
---
 libavformat/movenc.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

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

> This way we have a single location in movenc which utilizes the
> CPB properties.
> ---
> libavformat/movenc.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)

Looks ok

// Martin
diff mbox series

Patch

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 33331962f2..31e1ac1589 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4155,7 +4155,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;
-    AVCPBProperties *props = NULL;
 
     static const uint8_t uuid[] = {
         0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd,
@@ -4181,6 +4180,8 @@  static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat
 
     for (i = 0; i < mov->nb_streams; i++) {
         MOVTrack *track = &mov->tracks[i];
+        struct mpeg4_bit_rate_values bit_rates = \
+            calculate_mpeg4_bit_rates(track);
         const char *type;
         int track_id = track->track_id;
         char track_name_buf[32] = { 0 };
@@ -4196,12 +4197,10 @@  static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat
             continue;
         }
 
-        props = (AVCPBProperties*)av_stream_get_side_data(track->st, AV_PKT_DATA_CPB_PROPERTIES, NULL);
-
         if (track->par->bit_rate) {
             manifest_bit_rate = track->par->bit_rate;
-        } else if (props) {
-            manifest_bit_rate = props->max_bitrate;
+        } else {
+            manifest_bit_rate = bit_rates.max_bit_rate;
         }
 
         avio_printf(pb, "<%s systemBitrate=\"%"PRId64"\">\n", type,