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 <lq@chinaffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
release/7.0
Andreas Rheinhardt 9 months ago
parent d085f341d6
commit 440f8186ef
  1. 2
      libavformat/dashenc.c
  2. 2
      libavformat/hlsenc.c

@ -1747,7 +1747,7 @@ static int dash_write_header(AVFormatContext *s)
(ret = flush_init_segment(s, os)) < 0) (ret = flush_init_segment(s, os)) < 0)
return ret; return ret;
} }
return ret; return 0;
} }
static int add_segment(OutputStream *os, const char *file, static int add_segment(OutputStream *os, const char *file,

@ -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) static int hls_init_file_resend(AVFormatContext *s, VariantStream *vs)

Loading…
Cancel
Save