aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/samidec.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/samidec.c
parentef1302db2db67d483fcc37b0bbced61394c3620b (diff)
downloadffmpeg-ea5bdc8893e4c1d5c3b417afad78ccedaa831789.tar.gz
avformat/subtitles: Deduplicate subtitles' read_(packet|seek|close)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/samidec.c')
-rw-r--r--libavformat/samidec.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/libavformat/samidec.c b/libavformat/samidec.c
index c23335cf4d..698164b6a2 100644
--- a/libavformat/samidec.c
+++ b/libavformat/samidec.c
@@ -119,27 +119,6 @@ end:
return res;
}
-static int sami_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
- SAMIContext *sami = s->priv_data;
- return ff_subtitles_queue_read_packet(&sami->q, pkt);
-}
-
-static int sami_read_seek(AVFormatContext *s, int stream_index,
- int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
-{
- SAMIContext *sami = s->priv_data;
- return ff_subtitles_queue_seek(&sami->q, s, stream_index,
- min_ts, ts, max_ts, flags);
-}
-
-static int sami_read_close(AVFormatContext *s)
-{
- SAMIContext *sami = s->priv_data;
- ff_subtitles_queue_clean(&sami->q);
- return 0;
-}
-
const AVInputFormat ff_sami_demuxer = {
.name = "sami",
.long_name = NULL_IF_CONFIG_SMALL("SAMI subtitle format"),
@@ -147,8 +126,8 @@ const AVInputFormat ff_sami_demuxer = {
.flags_internal = FF_FMT_INIT_CLEANUP,
.read_probe = sami_probe,
.read_header = sami_read_header,
- .read_packet = sami_read_packet,
- .read_seek2 = sami_read_seek,
- .read_close = sami_read_close,
.extensions = "smi,sami",
+ .read_packet = ff_subtitles_read_packet,
+ .read_seek2 = ff_subtitles_read_seek,
+ .read_close = ff_subtitles_read_close,
};