From patchwork Tue Mar 23 14:13:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zane van Iperen X-Patchwork-Id: 26570 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 3777744BC28 for ; Tue, 23 Mar 2021 16:13:56 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 22FAB68ABD5; Tue, 23 Mar 2021 16:13:56 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0B06768AB27 for ; Tue, 23 Mar 2021 16:13:44 +0200 (EET) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zanevaniperen.com; s=key1; t=1616508821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nV5pd4MT4MBahGFYGelBDW0TUa3B7ygaRqwDRYvJTbQ=; b=k1ehgxbLY9MpACD4ToLWp7B/eXc8r0VJsWVpz/DcnO4ihEU6bPJRNkpQsgRird0WlgJfv8 YCP+4LUi8W0DbupJ2n4WqKX7kPLTu4/x/SsCMxIf2KNcGpH6Hq6HYybAc5nLwCjhZW/NJy dV5wzf7u+RZHgXpAKlC+7e8yQIuloV5VBda2Om/Wg4+saDirtm/pQJ876MXd4cgjGnInPD 8I/tucbogGRVPQF4E9nLFRdka1nBYxFEsRcsDoSzlU7KnC72ZsQv10WKM8lZo4NW0JiGqP ocbJsn8PrwO5X3KUsLCVFctMsP7NNtW869HTxnmdnJIP074lGBqV42ozss7Feg== From: Zane van Iperen To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 Mar 2021 00:13:02 +1000 Message-Id: <20210323141305.19229-8-zane@zanevaniperen.com> In-Reply-To: <20210323141305.19229-1-zane@zanevaniperen.com> References: <20210323141305.19229-1-zane@zanevaniperen.com> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: git-morningstar@zanevaniperen.com Subject: [FFmpeg-devel] [PATCH 08/11] avformat/kvag: allow seeking to start X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Zane van Iperen Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Allows "ffplay -loop" to work. Signed-off-by: Zane van Iperen --- 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