diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2015-04-05 14:28:38 -0400 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2015-11-02 14:35:28 +0000 |
commit | 9ae73d0644cde27d3d93d41a5d8bc94de853ea91 (patch) | |
tree | 825d8d98fb1d6003ed92160833366f07286f0c94 /libavformat | |
parent | 430f943e63cc6da2236a1c98be5b23aa649e72e1 (diff) | |
download | ffmpeg-9ae73d0644cde27d3d93d41a5d8bc94de853ea91.tar.gz |
hlsenc: Only write PAT/PMT once per segment
This saves a lot of muxing overhead, especially on lower bitrate
segments.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/hlsenc.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 8daf53f8bb..d7884e5c40 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -560,8 +560,16 @@ static int hls_start(AVFormatContext *s) } av_dict_free(&options); - if (oc->oformat->priv_class && oc->priv_data) + /* We only require one PAT/PMT per segment. */ + if (oc->oformat->priv_class && oc->priv_data) { + char period[21]; + + snprintf(period, sizeof(period), "%d", (INT_MAX / 2) - 1); + av_opt_set(oc->priv_data, "mpegts_flags", "resend_headers", 0); + av_opt_set(oc->priv_data, "sdt_period", period, 0); + av_opt_set(oc->priv_data, "pat_period", period, 0); + } if (c->vtt_basename) avformat_write_header(vtt_oc,NULL); |