diff mbox series

[FFmpeg-devel,v2,2/2] avformat/hlsenc: expand the scope of flags from int32_t to int64_t

Message ID 20220508011722.4072-2-lq@chinaffmpeg.org
State New
Headers show
Series [FFmpeg-devel,v2,1/2] avformat/hlsenc: check discont_program_date_time before use it in parse_playlist | 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

Commit Message

Liu Steven May 8, 2022, 1:17 a.m. UTC
because the flags in AVOption support i64.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
---
 libavformat/hlsenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Zhao Zhili May 8, 2022, 10:22 a.m. UTC | #1
> On May 8, 2022, at 9:17 AM, Steven Liu <lq@chinaffmpeg.org> wrote:
> 
> because the flags in AVOption support i64.
> 
> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
> ---
> libavformat/hlsenc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index b9f79e30d8..00645ae74e 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -202,7 +202,7 @@ typedef struct HLSContext {
>     int64_t init_time;     // Set by a private option.
>     int max_nb_segments;   // Set by a private option.
>     int hls_delete_threshold; // Set by a private option.
> -    uint32_t flags;        // enum HLSFlags
> +    uint64_t flags;        // enum HLSFlags

Actually it should be int here.

Firstly, AV_OPT_TYPE_FLAGS is accessed as int in opt.c.
uint64_t only works with little endian system.

Secondly, enum HLSFlags cannot has value larger than int.

>     uint32_t pl_type;      // enum PlaylistType
>     char *segment_filename;
>     char *fmp4_init_filename;
> -- 
> 2.34.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".
diff mbox series

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index b9f79e30d8..00645ae74e 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -202,7 +202,7 @@  typedef struct HLSContext {
     int64_t init_time;     // Set by a private option.
     int max_nb_segments;   // Set by a private option.
     int hls_delete_threshold; // Set by a private option.
-    uint32_t flags;        // enum HLSFlags
+    uint64_t flags;        // enum HLSFlags
     uint32_t pl_type;      // enum PlaylistType
     char *segment_filename;
     char *fmp4_init_filename;