mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-28 12:32:17 +02:00
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>
This commit is contained in:
parent
1ebda24904
commit
511bd6af47
@ -207,8 +207,6 @@ static int srt_read_header(AVFormatContext *s)
|
|||||||
ff_subtitles_queue_finalize(s, &srt->q);
|
ff_subtitles_queue_finalize(s, &srt->q);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (res < 0)
|
|
||||||
ff_subtitles_queue_clean(&srt->q);
|
|
||||||
av_bprint_finalize(&buf, NULL);
|
av_bprint_finalize(&buf, NULL);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -238,6 +236,7 @@ const AVInputFormat ff_srt_demuxer = {
|
|||||||
.name = "srt",
|
.name = "srt",
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"),
|
.long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"),
|
||||||
.priv_data_size = sizeof(SRTContext),
|
.priv_data_size = sizeof(SRTContext),
|
||||||
|
.flags_internal = FF_FMT_INIT_CLEANUP,
|
||||||
.read_probe = srt_probe,
|
.read_probe = srt_probe,
|
||||||
.read_header = srt_read_header,
|
.read_header = srt_read_header,
|
||||||
.read_packet = srt_read_packet,
|
.read_packet = srt_read_packet,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user