avformat/hlsenc: Localize initialization of subtitle streams

Before this commit, the checks were unnecessarily scattered.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
Andreas Rheinhardt 2019-12-15 22:12:53 +01:00
parent 191b51254c
commit e1dfb5128b
1 changed files with 3 additions and 7 deletions

View 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";