[FFmpeg-devel] [PATCH v2 5/7] avformat/hlsenc: Localize initialization of subtitle streams
Andreas Rheinhardt
andreas.rheinhardt at gmail.com
Fri Feb 28 11:53:19 EET 2020
Before this commit, the checks were unnecessarily scattered.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
Now not moving variables into a smaller scope.
libavformat/hlsenc.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 4628ea15c7..e3a310dbc1 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2798,13 +2798,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)
@@ -2899,6 +2892,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";
--
2.20.1
More information about the ffmpeg-devel
mailing list