summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhuheng <heng.hu.1989@gmail.com>2022-06-27 21:30:11 +0800
committerSteven Liu <lq@chinaffmpeg.org>2022-06-29 14:07:03 +0800
commit8d4bdf99e5650019e25174de3ff41c8c3396a904 (patch)
tree219feb3a1adf2cf3c5b8e28508abed91deb696cb
parentdf8ad4e3914c65d3ebcaac10bac6038eadb70d74 (diff)
avformat/hlsenc: Add resend_headers option
Add pat and pmt table at start of each segment in single_file mode enhanced compatibility of hls stream. Because some hls clients separate parsing segment of hls stream, the absence of pat/pmt will cause parsing to fail. Reviewed-by: Steven Liu <liuqi05@kuaishou.com> Signed-off-by: huheng <heng.hu.1989@gmail.com>
-rw-r--r--libavformat/hlsenc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 7c097b4bf2..6f49ae1aa2 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2635,6 +2635,9 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
vs->start_pos += vs->size;
if (hls->key_info_file || hls->encrypt)
ret = hls_start(s, vs);
+ if (hls->segment_type == SEGMENT_TYPE_MPEGTS && oc->oformat->priv_class && oc->priv_data) {
+ av_opt_set(oc->priv_data, "mpegts_flags", "resend_headers", 0);
+ }
} else if (hls->max_seg_size > 0) {
if (vs->size + vs->start_pos >= hls->max_seg_size) {
vs->sequence++;