diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2020-03-21 18:31:06 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-07-08 13:57:42 +0200 |
commit | 511bd6af47c8dcc4139065e203de10eb5d40f39c (patch) | |
tree | 2ec783c2c0809146a19c1bbbca441a27901619d6 /libavformat/srtdec.c | |
parent | 1ebda24904d786a1d57093da3d6a1eec5ea939a4 (diff) | |
download | ffmpeg-511bd6af47c8dcc4139065e203de10eb5d40f39c.tar.gz |
avformat/srtdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/srtdec.c')
-rw-r--r-- | libavformat/srtdec.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c index fa52b85566..2f8a677b9f 100644 --- a/libavformat/srtdec.c +++ b/libavformat/srtdec.c @@ -207,8 +207,6 @@ static int srt_read_header(AVFormatContext *s) ff_subtitles_queue_finalize(s, &srt->q); end: - if (res < 0) - ff_subtitles_queue_clean(&srt->q); av_bprint_finalize(&buf, NULL); return res; } @@ -238,6 +236,7 @@ const AVInputFormat ff_srt_demuxer = { .name = "srt", .long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"), .priv_data_size = sizeof(SRTContext), + .flags_internal = FF_FMT_INIT_CLEANUP, .read_probe = srt_probe, .read_header = srt_read_header, .read_packet = srt_read_packet, |