diff mbox series

[FFmpeg-devel,v2] avformat/hlsenc: Respect `omit_endlist` flag in subtitle playlists

Message ID 20240928172858.33025-1-jonbae77@gmail.com
State New
Headers show
Series [FFmpeg-devel,v2] avformat/hlsenc: Respect `omit_endlist` flag in subtitle playlists | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Jonathan Baecker Sept. 28, 2024, 5:28 p.m. UTC
Ensure that when the `-hls_flags omit_endlist` option is set,
the `#EXT-X-ENDLIST` tag is also omitted from the `stream_vtt.m3u8`
subtitle playlist. This maintains consistency with the behavior
in other playlists when `omit_endlist` is specified.
---
 libavformat/hlsenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.46.1

Comments

Steven Liu Sept. 30, 2024, 11:24 a.m. UTC | #1
Jonathan Baecker <jonbae77@gmail.com> 于2024年9月29日周日 01:29写道:
Hi Jonathan,

>
> Ensure that when the `-hls_flags omit_endlist` option is set,
> the `#EXT-X-ENDLIST` tag is also omitted from the `stream_vtt.m3u8`
> subtitle playlist. This maintains consistency with the behavior
> in other playlists when `omit_endlist` is specified.
> ---
>  libavformat/hlsenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index 1e932b7..528ba0f 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -1676,7 +1676,7 @@ static int hls_window(AVFormatContext *s, int last, VariantStream *vs)
>              }
>          }
>
> -        if (last)
> +        if (last && (hls->flags & HLS_OMIT_ENDLIST)==0)
x==0 / x!=0 can be simplified to !x / x
/Users/StevenLiu/FFmpeg-devel-v2-avformat-hlsenc-Respect-omit_endlist-flag-in-subtitle-playlists.patch:154:+
       if (last && (hls->flags & HLS_OMIT_ENDLIST)==0)

>              ff_hls_write_end_list(hls->sub_m3u8_out);
>
>      }
> --
> 2.46.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

Thanks
Steven
diff mbox series

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 1e932b7..528ba0f 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -1676,7 +1676,7 @@  static int hls_window(AVFormatContext *s, int last, VariantStream *vs)
             }
         }

-        if (last)
+        if (last && (hls->flags & HLS_OMIT_ENDLIST)==0)
             ff_hls_write_end_list(hls->sub_m3u8_out);

     }