[FFmpeg-cvslog] avformat/kvag: allow seeking to start

Zane van Iperen git at videolan.org
Thu Mar 25 08:39:00 EET 2021


ffmpeg | branch: release/4.4 | Zane van Iperen <zane at zanevaniperen.com> | Mon Mar 22 22:44:56 2021 +1000| [a98413afb9e3d8e8768434a727924fa5c498a49f] | committer: Zane van Iperen

avformat/kvag: allow seeking to start

Allows "ffplay -loop" to work.

Signed-off-by: Zane van Iperen <zane at zanevaniperen.com>
(cherry picked from commit 3cc4a140ef18e340fa3f003daf66ded8c275de38)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a98413afb9e3d8e8768434a727924fa5c498a49f
---

 libavformat/kvag.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

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
 



More information about the ffmpeg-cvslog mailing list