Commit e1dfb512 authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

avformat/hlsenc: Localize initialization of subtitle streams

Before this commit, the checks were unnecessarily scattered.
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
parent 191b5125
...@@ -2878,13 +2878,6 @@ static int hls_init(AVFormatContext *s) ...@@ -2878,13 +2878,6 @@ static int hls_init(AVFormatContext *s)
goto fail; 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) { if (hls->segment_filename) {
ret = format_name(hls->segment_filename, &vs->basename, i, vs->varname); ret = format_name(hls->segment_filename, &vs->basename, i, vs->varname);
if (ret < 0) if (ret < 0)
...@@ -2979,6 +2972,9 @@ static int hls_init(AVFormatContext *s) ...@@ -2979,6 +2972,9 @@ static int hls_init(AVFormatContext *s)
goto fail; goto fail;
if (vs->has_subtitle) { 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) if (hls->flags & HLS_SINGLE_FILE)
vtt_pattern = ".vtt"; vtt_pattern = ".vtt";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment