Merge commit '5845a8273e4694e0254ad728970b82bb64fd8bc0'

* commit '5845a8273e4694e0254ad728970b82bb64fd8bc0':
  movenc: use the CPB props side data

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
This commit is contained in:
Hendrik Leppkes 2015-12-17 13:50:36 +01:00
commit f95385dd58
1 changed files with 6 additions and 3 deletions

View File

@ -555,6 +555,7 @@ static unsigned compute_avg_bitrate(MOVTrack *track)
static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic
{
AVCPBProperties *props;
int64_t pos = avio_tell(pb);
int decoder_specific_info_len = track->vos_len ? 5 + track->vos_len : 0;
unsigned avg_bitrate;
@ -588,11 +589,13 @@ static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic
else
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);
// 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, 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, avg_bitrate);
if (track->vos_len) {