avformat/hlsenc: Localize initialization of subtitle streams

Before this commit, the checks were unnecessarily scattered.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
pull/338/head
Andreas Rheinhardt 5 years ago
parent 191b51254c
commit e1dfb5128b
  1. 10
      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";

Loading…
Cancel
Save