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/jacosubdec.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/jacosubdec.c')
-rw-r--r-- | libavformat/jacosubdec.c | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/libavformat/jacosubdec.c b/libavformat/jacosubdec.c index 510219224f..8cb918ccee 100644 --- a/libavformat/jacosubdec.c +++ b/libavformat/jacosubdec.c @@ -35,9 +35,9 @@ #include "libavutil/intreadwrite.h" typedef struct { + FFDemuxSubtitlesQueue q; int shift; unsigned timeres; - FFDemuxSubtitlesQueue q; } JACOsubContext; static int timed_line(const char *ptr) @@ -93,13 +93,6 @@ static int get_jss_cmd(char k) return -1; } -static int jacosub_read_close(AVFormatContext *s) -{ - JACOsubContext *jacosub = s->priv_data; - ff_subtitles_queue_clean(&jacosub->q); - return 0; -} - static const char *read_ts(JACOsubContext *jacosub, const char *buf, int64_t *start, int64_t *duration) { @@ -258,20 +251,6 @@ static int jacosub_read_header(AVFormatContext *s) return 0; } -static int jacosub_read_packet(AVFormatContext *s, AVPacket *pkt) -{ - JACOsubContext *jacosub = s->priv_data; - return ff_subtitles_queue_read_packet(&jacosub->q, pkt); -} - -static int jacosub_read_seek(AVFormatContext *s, int stream_index, - int64_t min_ts, int64_t ts, int64_t max_ts, int flags) -{ - JACOsubContext *jacosub = s->priv_data; - return ff_subtitles_queue_seek(&jacosub->q, s, stream_index, - min_ts, ts, max_ts, flags); -} - const AVInputFormat ff_jacosub_demuxer = { .name = "jacosub", .long_name = NULL_IF_CONFIG_SMALL("JACOsub subtitle format"), @@ -279,7 +258,7 @@ const AVInputFormat ff_jacosub_demuxer = { .flags_internal = FF_FMT_INIT_CLEANUP, .read_probe = jacosub_probe, .read_header = jacosub_read_header, - .read_packet = jacosub_read_packet, - .read_seek2 = jacosub_read_seek, - .read_close = jacosub_read_close, + .read_packet = ff_subtitles_read_packet, + .read_seek2 = ff_subtitles_read_seek, + .read_close = ff_subtitles_read_close, }; |