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/vplayerdec.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/vplayerdec.c')
-rw-r--r-- | libavformat/vplayerdec.c | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/libavformat/vplayerdec.c b/libavformat/vplayerdec.c index 8c9ff81163..b37f6c8f64 100644 --- a/libavformat/vplayerdec.c +++ b/libavformat/vplayerdec.c @@ -95,27 +95,6 @@ static int vplayer_read_header(AVFormatContext *s) return 0; } -static int vplayer_read_packet(AVFormatContext *s, AVPacket *pkt) -{ - VPlayerContext *vplayer = s->priv_data; - return ff_subtitles_queue_read_packet(&vplayer->q, pkt); -} - -static int vplayer_read_seek(AVFormatContext *s, int stream_index, - int64_t min_ts, int64_t ts, int64_t max_ts, int flags) -{ - VPlayerContext *vplayer = s->priv_data; - return ff_subtitles_queue_seek(&vplayer->q, s, stream_index, - min_ts, ts, max_ts, flags); -} - -static int vplayer_read_close(AVFormatContext *s) -{ - VPlayerContext *vplayer = s->priv_data; - ff_subtitles_queue_clean(&vplayer->q); - return 0; -} - const AVInputFormat ff_vplayer_demuxer = { .name = "vplayer", .long_name = NULL_IF_CONFIG_SMALL("VPlayer subtitles"), @@ -123,8 +102,8 @@ const AVInputFormat ff_vplayer_demuxer = { .flags_internal = FF_FMT_INIT_CLEANUP, .read_probe = vplayer_probe, .read_header = vplayer_read_header, - .read_packet = vplayer_read_packet, - .read_seek2 = vplayer_read_seek, - .read_close = vplayer_read_close, .extensions = "txt", + .read_packet = ff_subtitles_read_packet, + .read_seek2 = ff_subtitles_read_seek, + .read_close = ff_subtitles_read_close, }; |