summaryrefslogtreecommitdiff
path: root/libavformat/pjsdec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-07-08 23:05:08 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-07-18 04:26:35 +0200
commitea5bdc8893e4c1d5c3b417afad78ccedaa831789 (patch)
treeffe3ceb74f180034696d6dfc503c939117ac38c8 /libavformat/pjsdec.c
parentef1302db2db67d483fcc37b0bbced61394c3620b (diff)
avformat/subtitles: Deduplicate subtitles' read_(packet|seek|close)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/pjsdec.c')
-rw-r--r--libavformat/pjsdec.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/libavformat/pjsdec.c b/libavformat/pjsdec.c
index 1fc16831ea..5b2111f726 100644
--- a/libavformat/pjsdec.c
+++ b/libavformat/pjsdec.c
@@ -105,27 +105,6 @@ static int pjs_read_header(AVFormatContext *s)
return 0;
}
-static int pjs_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
- PJSContext *pjs = s->priv_data;
- return ff_subtitles_queue_read_packet(&pjs->q, pkt);
-}
-
-static int pjs_read_seek(AVFormatContext *s, int stream_index,
- int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
-{
- PJSContext *pjs = s->priv_data;
- return ff_subtitles_queue_seek(&pjs->q, s, stream_index,
- min_ts, ts, max_ts, flags);
-}
-
-static int pjs_read_close(AVFormatContext *s)
-{
- PJSContext *pjs = s->priv_data;
- ff_subtitles_queue_clean(&pjs->q);
- return 0;
-}
-
const AVInputFormat ff_pjs_demuxer = {
.name = "pjs",
.long_name = NULL_IF_CONFIG_SMALL("PJS (Phoenix Japanimation Society) subtitles"),
@@ -133,8 +112,8 @@ const AVInputFormat ff_pjs_demuxer = {
.flags_internal = FF_FMT_INIT_CLEANUP,
.read_probe = pjs_probe,
.read_header = pjs_read_header,
- .read_packet = pjs_read_packet,
- .read_seek2 = pjs_read_seek,
- .read_close = pjs_read_close,
.extensions = "pjs",
+ .read_packet = ff_subtitles_read_packet,
+ .read_seek2 = ff_subtitles_read_seek,
+ .read_close = ff_subtitles_read_close,
};