1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

avformat/kvag: allow seeking to start

Allows "ffplay -loop" to work.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
(cherry picked from commit 3cc4a140ef)
This commit is contained in:
Zane van Iperen 2021-03-22 22:44:56 +10:00
parent 0cfea0581b
commit a98413afb9
No known key found for this signature in database
GPG Key ID: 68616B2D8AC4DCC5

View 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