diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-07-08 23:05:08 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-07-18 04:26:35 +0200 |
commit | ea5bdc8893e4c1d5c3b417afad78ccedaa831789 (patch) | |
tree | ffe3ceb74f180034696d6dfc503c939117ac38c8 /libavformat/sccdec.c | |
parent | ef1302db2db67d483fcc37b0bbced61394c3620b (diff) | |
download | ffmpeg-ea5bdc8893e4c1d5c3b417afad78ccedaa831789.tar.gz |
avformat/subtitles: Deduplicate subtitles' read_(packet|seek|close)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/sccdec.c')
-rw-r--r-- | libavformat/sccdec.c | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/libavformat/sccdec.c b/libavformat/sccdec.c index e59e015bbc..e95fd881a3 100644 --- a/libavformat/sccdec.c +++ b/libavformat/sccdec.c @@ -177,27 +177,6 @@ static int scc_read_header(AVFormatContext *s) return 0; } -static int scc_read_packet(AVFormatContext *s, AVPacket *pkt) -{ - SCCContext *scc = s->priv_data; - return ff_subtitles_queue_read_packet(&scc->q, pkt); -} - -static int scc_read_seek(AVFormatContext *s, int stream_index, - int64_t min_ts, int64_t ts, int64_t max_ts, int flags) -{ - SCCContext *scc = s->priv_data; - return ff_subtitles_queue_seek(&scc->q, s, stream_index, - min_ts, ts, max_ts, flags); -} - -static int scc_read_close(AVFormatContext *s) -{ - SCCContext *scc = s->priv_data; - ff_subtitles_queue_clean(&scc->q); - return 0; -} - const AVInputFormat ff_scc_demuxer = { .name = "scc", .long_name = NULL_IF_CONFIG_SMALL("Scenarist Closed Captions"), @@ -205,8 +184,8 @@ const AVInputFormat ff_scc_demuxer = { .flags_internal = FF_FMT_INIT_CLEANUP, .read_probe = scc_probe, .read_header = scc_read_header, - .read_packet = scc_read_packet, - .read_seek2 = scc_read_seek, - .read_close = scc_read_close, .extensions = "scc", + .read_packet = ff_subtitles_read_packet, + .read_seek2 = ff_subtitles_read_seek, + .read_close = ff_subtitles_read_close, }; |