From 440f8186ef9baf3f581fc463f318014d3176c4cd Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Tue, 5 Mar 2024 11:15:36 +0100 Subject: [PATCH] avformat/dashenc, hlsenc: Return 0 on succes from write_header Do not propagate the return value of avformat_write_header(), as it contains the information whether the output had already been initialized in avformat_init_output(), but this is set generically; the return value of FFOutputFormat.write_header is not documented at all (and is currently ignored if >= 0), but it is more future-proof to simply return 0 on success. Reviewed-by: Liu Steven Signed-off-by: Andreas Rheinhardt --- libavformat/dashenc.c | 2 +- libavformat/hlsenc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 435a5e8afe..5e31b09486 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -1747,7 +1747,7 @@ static int dash_write_header(AVFormatContext *s) (ret = flush_init_segment(s, os)) < 0) return ret; } - return ret; + return 0; } static int add_segment(OutputStream *os, const char *file, diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index d5cd627e59..e560aa6a20 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2372,7 +2372,7 @@ static int hls_write_header(AVFormatContext *s) } } - return ret; + return 0; } static int hls_init_file_resend(AVFormatContext *s, VariantStream *vs)