diff mbox series

[FFmpeg-devel,v1] avformat/hlsenc: Add resend_headers option

Message ID 20220627133011.57715-1-heng.hu.1989@gmail.com
State Accepted
Commit 8d4bdf99e5650019e25174de3ff41c8c3396a904
Headers show
Series [FFmpeg-devel,v1] avformat/hlsenc: Add resend_headers option | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_armv7_RPi4 success Make finished
andriy/make_fate_armv7_RPi4 success Make fate finished

Commit Message

hu heng June 27, 2022, 1:30 p.m. UTC
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.

Signed-off-by: huheng <heng.hu.1989@gmail.com>
---
 libavformat/hlsenc.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Steven Liu June 29, 2022, 4:18 a.m. UTC | #1
huheng <heng.hu.1989@gmail.com> 于2022年6月27日周一 21:30写道:
>
> 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.
>
> Signed-off-by: huheng <heng.hu.1989@gmail.com>
> ---
>  libavformat/hlsenc.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index 3bafddfa61..d18178e727 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -2631,6 +2631,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++;
> --
> 2.36.1
>

LGTM
Will apply soon


Thanks
Steven
diff mbox series

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 3bafddfa61..d18178e727 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2631,6 +2631,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++;