Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-07-09 00:05:08 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-07-18 05:26:35 +0300
commitea5bdc8893e4c1d5c3b417afad78ccedaa831789 (patch)
treeffe3ceb74f180034696d6dfc503c939117ac38c8 /libavformat/srtdec.c
parentef1302db2db67d483fcc37b0bbced61394c3620b (diff)
avformat/subtitles: Deduplicate subtitles' read_(packet|seek|close)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/srtdec.c')
-rw-r--r--libavformat/srtdec.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c
index 2f8a677b9f..bf02450555 100644
--- a/libavformat/srtdec.c
+++ b/libavformat/srtdec.c
@@ -211,27 +211,6 @@ end:
return res;
}
-static int srt_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
- SRTContext *srt = s->priv_data;
- return ff_subtitles_queue_read_packet(&srt->q, pkt);
-}
-
-static int srt_read_seek(AVFormatContext *s, int stream_index,
- int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
-{
- SRTContext *srt = s->priv_data;
- return ff_subtitles_queue_seek(&srt->q, s, stream_index,
- min_ts, ts, max_ts, flags);
-}
-
-static int srt_read_close(AVFormatContext *s)
-{
- SRTContext *srt = s->priv_data;
- ff_subtitles_queue_clean(&srt->q);
- return 0;
-}
-
const AVInputFormat ff_srt_demuxer = {
.name = "srt",
.long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"),
@@ -239,7 +218,7 @@ const AVInputFormat ff_srt_demuxer = {
.flags_internal = FF_FMT_INIT_CLEANUP,
.read_probe = srt_probe,
.read_header = srt_read_header,
- .read_packet = srt_read_packet,
- .read_seek2 = srt_read_seek,
- .read_close = srt_read_close,
+ .read_packet = ff_subtitles_read_packet,
+ .read_seek2 = ff_subtitles_read_seek,
+ .read_close = ff_subtitles_read_close,
};