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/mpl2dec.c | |
parent | ef1302db2db67d483fcc37b0bbced61394c3620b (diff) |
avformat/subtitles: Deduplicate subtitles' read_(packet|seek|close)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/mpl2dec.c')
-rw-r--r-- | libavformat/mpl2dec.c | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/libavformat/mpl2dec.c b/libavformat/mpl2dec.c index 0beb9ca388..912a707d1a 100644 --- a/libavformat/mpl2dec.c +++ b/libavformat/mpl2dec.c @@ -122,27 +122,6 @@ static int mpl2_read_header(AVFormatContext *s) return 0; } -static int mpl2_read_packet(AVFormatContext *s, AVPacket *pkt) -{ - MPL2Context *mpl2 = s->priv_data; - return ff_subtitles_queue_read_packet(&mpl2->q, pkt); -} - -static int mpl2_read_seek(AVFormatContext *s, int stream_index, - int64_t min_ts, int64_t ts, int64_t max_ts, int flags) -{ - MPL2Context *mpl2 = s->priv_data; - return ff_subtitles_queue_seek(&mpl2->q, s, stream_index, - min_ts, ts, max_ts, flags); -} - -static int mpl2_read_close(AVFormatContext *s) -{ - MPL2Context *mpl2 = s->priv_data; - ff_subtitles_queue_clean(&mpl2->q); - return 0; -} - const AVInputFormat ff_mpl2_demuxer = { .name = "mpl2", .long_name = NULL_IF_CONFIG_SMALL("MPL2 subtitles"), @@ -150,8 +129,8 @@ const AVInputFormat ff_mpl2_demuxer = { .flags_internal = FF_FMT_INIT_CLEANUP, .read_probe = mpl2_probe, .read_header = mpl2_read_header, - .read_packet = mpl2_read_packet, - .read_seek2 = mpl2_read_seek, - .read_close = mpl2_read_close, .extensions = "txt,mpl2", + .read_packet = ff_subtitles_read_packet, + .read_seek2 = ff_subtitles_read_seek, + .read_close = ff_subtitles_read_close, }; |