Before this commit, the checks were unnecessarily scattered. Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@gmail.com> --- Now not moving variables into a smaller scope.
libavformat/hlsenc.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 4628ea15c7..e3a310dbc1 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2798,13 +2798,6 @@ static int hls_init(AVFormatContext *s) goto fail; } - if (vs->has_subtitle) { - vs->vtt_oformat = av_guess_format("webvtt", NULL, NULL); - if (!vs->vtt_oformat) { - ret = AVERROR_MUXER_NOT_FOUND; - goto fail; - } - } if (hls->segment_filename) { ret = format_name(hls->segment_filename, &vs->basename, i, vs->varname); if (ret < 0) @@ -2899,6 +2892,9 @@ static int hls_init(AVFormatContext *s) goto fail; if (vs->has_subtitle) { + vs->vtt_oformat = av_guess_format("webvtt", NULL, NULL); + if (!vs->vtt_oformat) + return AVERROR_MUXER_NOT_FOUND; if (hls->flags & HLS_SINGLE_FILE) vtt_pattern = ".vtt"; -- 2.20.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-requ...@ffmpeg.org with subject "unsubscribe".