]> git.sesse.net Git - ffmpeg/commitdiff
avformat/hlsenc: Localize initialization of subtitle streams
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 15 Dec 2019 21:12:53 +0000 (22:12 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 8 May 2020 13:35:06 +0000 (15:35 +0200)
Before this commit, the checks were unnecessarily scattered.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/hlsenc.c

index 20f66d52d1553b6a88bb3b08986a5163497a13ec..3d5b09c9634883747b6e78a8e56ac130c5ce1c90 100644 (file)
@@ -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";