summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-12-15 22:12:53 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-05-08 15:35:06 +0200
commite1dfb5128b90f7a3253465599eeb6d6718359da8 (patch)
tree92a69ed941650e00a3a82a9fda63fab10eca27b6 /libavformat
parent191b51254cf5d37c84af51d434993efe174b0977 (diff)
avformat/hlsenc: Localize initialization of subtitle streams
Before this commit, the checks were unnecessarily scattered. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/hlsenc.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 20f66d52d1..3d5b09c963 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";