]> git.sesse.net Git - ffmpeg/commitdiff
avformat/kvag: allow seeking to start
authorZane van Iperen <zane@zanevaniperen.com>
Mon, 22 Mar 2021 12:44:56 +0000 (22:44 +1000)
committerZane van Iperen <zane@zanevaniperen.com>
Thu, 25 Mar 2021 02:51:10 +0000 (12:51 +1000)
Allows "ffplay -loop" to work.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
libavformat/kvag.c

index 8f641873b9b491939eb9f6c55732143172b5f848..91d1d8a5182e6c6e08dbc5a2c45b349384b02360 100644 (file)
@@ -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