summaryrefslogtreecommitdiff
path: root/libavformat/kvag.c
diff options
context:
space:
mode:
authorZane van Iperen <zane@zanevaniperen.com>2021-03-22 22:44:56 +1000
committerZane van Iperen <zane@zanevaniperen.com>2021-03-25 12:51:10 +1000
commit3cc4a140ef18e340fa3f003daf66ded8c275de38 (patch)
tree1561856cf89a0ab91b3a39357d7e3006d8db87f2 /libavformat/kvag.c
parente550667f614dfd21dadd8a8e4ada806c48349beb (diff)
downloadffmpeg-3cc4a140ef18e340fa3f003daf66ded8c275de38.tar.gz
avformat/kvag: allow seeking to start
Allows "ffplay -loop" to work. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Diffstat (limited to 'libavformat/kvag.c')
-rw-r--r--libavformat/kvag.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libavformat/kvag.c b/libavformat/kvag.c
index 8f641873b9..91d1d8a518 100644
--- a/libavformat/kvag.c
+++ b/libavformat/kvag.c
@@ -110,12 +110,22 @@ static int kvag_read_packet(AVFormatContext *s, AVPacket *pkt)
return 0;
}
+static int kvag_seek(AVFormatContext *s, int stream_index,
+ int64_t pts, int flags)
+{
+ if (pts != 0)
+ return AVERROR(EINVAL);
+
+ return avio_seek(s->pb, KVAG_HEADER_SIZE, SEEK_SET);
+}
+
AVInputFormat ff_kvag_demuxer = {
.name = "kvag",
.long_name = NULL_IF_CONFIG_SMALL("Simon & Schuster Interactive VAG"),
.read_probe = kvag_probe,
.read_header = kvag_read_header,
- .read_packet = kvag_read_packet
+ .read_packet = kvag_read_packet,
+ .read_seek = kvag_seek,
};
#endif