Commit f95385dd authored by Hendrik Leppkes's avatar Hendrik Leppkes

Merge commit '5845a827'

* commit '5845a827':
  movenc: use the CPB props side data
Merged-by: 's avatarHendrik Leppkes <h.leppkes@gmail.com>
parents b2d8b91c 5845a827
...@@ -555,6 +555,7 @@ static unsigned compute_avg_bitrate(MOVTrack *track) ...@@ -555,6 +555,7 @@ static unsigned compute_avg_bitrate(MOVTrack *track)
static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic
{ {
AVCPBProperties *props;
int64_t pos = avio_tell(pb); int64_t pos = avio_tell(pb);
int decoder_specific_info_len = track->vos_len ? 5 + track->vos_len : 0; int decoder_specific_info_len = track->vos_len ? 5 + track->vos_len : 0;
unsigned avg_bitrate; unsigned avg_bitrate;
...@@ -588,11 +589,13 @@ static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic ...@@ -588,11 +589,13 @@ static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic
else else
avio_w8(pb, 0x11); // flags (= Visualstream) avio_w8(pb, 0x11); // flags (= Visualstream)
avio_wb24(pb, track->enc->rc_buffer_size >> 3); // Buffersize DB props = (AVCPBProperties*)av_stream_get_side_data(track->st, AV_PKT_DATA_CPB_PROPERTIES,
NULL);
avio_wb24(pb, props ? props->buffer_size / 8 : 0); // Buffersize DB
avg_bitrate = compute_avg_bitrate(track); avg_bitrate = compute_avg_bitrate(track);
// maxbitrate (FIXME should be max rate in any 1 sec window) avio_wb32(pb, props ? FFMAX3(props->max_bitrate, props->avg_bitrate, avg_bitrate) : FFMAX(track->enc->bit_rate, avg_bitrate)); // maxbitrate (FIXME should be max rate in any 1 sec window)
avio_wb32(pb, FFMAX3(track->enc->bit_rate, track->enc->rc_max_rate, avg_bitrate));
avio_wb32(pb, avg_bitrate); avio_wb32(pb, avg_bitrate);
if (track->vos_len) { if (track->vos_len) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment