avformat/dashenc: addition of muxer overhead in master playlist's bandwidth

pull/298/head
Vishwanath Dixit 7 years ago committed by Karthick Jeyapal
parent 85ae55eca3
commit 0c7bc7eb47
  1. 7
      libavformat/dashenc.c

@ -827,20 +827,23 @@ static int write_manifest(AVFormatContext *s, int final)
for (i = 0; i < s->nb_streams; i++) { for (i = 0; i < s->nb_streams; i++) {
char playlist_file[64]; char playlist_file[64];
AVStream *st = s->streams[i]; AVStream *st = s->streams[i];
OutputStream *os = &c->streams[i];
if (st->codecpar->codec_type != AVMEDIA_TYPE_AUDIO) if (st->codecpar->codec_type != AVMEDIA_TYPE_AUDIO)
continue; continue;
get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, i); get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, i);
ff_hls_write_audio_rendition(out, (char *)audio_group, ff_hls_write_audio_rendition(out, (char *)audio_group,
playlist_file, i, is_default); playlist_file, i, is_default);
max_audio_bitrate = FFMAX(st->codecpar->bit_rate, max_audio_bitrate); max_audio_bitrate = FFMAX(st->codecpar->bit_rate +
os->muxer_overhead, max_audio_bitrate);
is_default = 0; is_default = 0;
} }
for (i = 0; i < s->nb_streams; i++) { for (i = 0; i < s->nb_streams; i++) {
char playlist_file[64]; char playlist_file[64];
AVStream *st = s->streams[i]; AVStream *st = s->streams[i];
OutputStream *os = &c->streams[i];
char *agroup = NULL; char *agroup = NULL;
int stream_bitrate = st->codecpar->bit_rate; int stream_bitrate = st->codecpar->bit_rate + os->muxer_overhead;
if ((st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) && max_audio_bitrate) { if ((st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) && max_audio_bitrate) {
agroup = (char *)audio_group; agroup = (char *)audio_group;
stream_bitrate += max_audio_bitrate; stream_bitrate += max_audio_bitrate;

Loading…
Cancel
Save