From: Andreas Rheinhardt Date: Sun, 15 Dec 2019 21:12:53 +0000 (+0100) Subject: avformat/hlsenc: Localize initialization of subtitle streams X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=e1dfb5128b90f7a3253465599eeb6d6718359da8;p=ffmpeg avformat/hlsenc: Localize initialization of subtitle streams Before this commit, the checks were unnecessarily scattered. Signed-off-by: Andreas Rheinhardt --- diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 20f66d52d15..3d5b09c9634 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2878,13 +2878,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) @@ -2979,6 +2972,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";