From patchwork Sun Aug 22 11:29:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29722 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp1202482iov; Sun, 22 Aug 2021 04:31:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLnrGFQzsvu7wFlLcmcewxZRW6vYDddq7b9jCrePsG31J7VEFSzAJ7QHhml+Fm602caHPt X-Received: by 2002:a17:906:5a69:: with SMTP id my41mr30142771ejc.220.1629631878023; Sun, 22 Aug 2021 04:31:18 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y21si11127964edq.281.2021.08.22.04.31.17; Sun, 22 Aug 2021 04:31:18 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b="aaCC/P8Z"; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 778FB68A2A2; Sun, 22 Aug 2021 14:31:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2041.outbound.protection.outlook.com [40.92.90.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0920F6898A8 for ; Sun, 22 Aug 2021 14:31:05 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S8aQXRF/Eh6DFTxkTxXb+N6ufFL+sLujTQ7loZ1mp++wnrfqbJtz/enq+Rh/256oVK1yOTi2w5a14pMnAJMuYKmpRAobaQtbvlzQLFn0opvUNY2cAiHyV2PriuwYpq5rNmR8taEZOMqo+haaZ0qshWpsewOV/1ixSrX5QCGCCicvXUSoXbPt0j9OhCQHufZG8W6JO0+aVfnPk3+Vff3Oz+ofNPUUZVF2VpuOPdZuapCKTGVCSXtRRfKMCSdAO49aL7sS7yTcC6rGAcS5c3F9ui5BGkosEFUN1nYwufzGJPv2q3a8ut71YdbCyH2g49tpzgTGAEul/jU2VAmIkzblFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g0qTPHgbNzYdn813W1+RvOiAPPKKx+x2d5ZWc5ogIWs=; b=XnoUyOHQtzWaFJjAVQKheyDxQjgW3/Kt4cLHFHdf3fwbHyy9GCr6iyXoF/CcJnImhRS9dRm7QT+uzy+p0hob8kucElviRaEtoIeOI3RS2o0Jh+cLQRqAIGKVJ2p40k+JeZ5z1DxAKGjF4jPCiYsR+6oCJZL9S5jmhtbW0yOXd6PQxgz7+uhfgm69e6YR5WM/SOVfpDViqRRJ7OyAcEQr3/M45/NsaFa3RVEFMUCwisVDKtYADtSd4h/mxXnax1XQWX0HqTwsvQUO5hUZPWBeDmoRl+TCkjPWCct3XrGnhHkt8IMeoBXtxKM2wIAhi9EbCSNwVmdMoYFwpOQwQl1HoQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g0qTPHgbNzYdn813W1+RvOiAPPKKx+x2d5ZWc5ogIWs=; b=aaCC/P8ZGj+/nvm1uZwjhTl7WgXQcwfVPW4FEuEhQtVqhgV1kPF6dSvTnrp8k/3YbJoTKojrPMxo2zoVYFkvokgu47u9K/bDRNBpNEnNWIUehr7UukYLSpwFXvaiXVxLd9cXYPY4m2aAyJR7PpibNfTeUVqm47NMO969tll/Jg6fxr8RCsnodAHl8uQbETsEuAnAGEEQGAquJXsYZeTUHP5E+2Hj5YOUiVfWU4I8G17qhEzDQmWLZKzKhveiqgUtAu2qbBhm4MK0dTZKamQ/D/I/awj7MPP9WlNA43m5pdKxnYEktHtLAgolE19aPZ/DEe+YsH/Wcq1X9mDaOCpiSQ== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB3765.eurprd03.prod.outlook.com (2603:10a6:209:2d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.17; Sun, 22 Aug 2021 11:31:00 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::5574:1fd:cce2:d590]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::5574:1fd:cce2:d590%5]) with mapi id 15.20.4436.023; Sun, 22 Aug 2021 11:31:00 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 22 Aug 2021 13:29:54 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [8/qcrX6O5vQkuOZvJwVyHYn87cDvn3Mf] X-ClientProxiedBy: PR1P264CA0033.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:19f::20) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210822112955.1434452-3-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.142.38) by PR1P264CA0033.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:19f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Sun, 22 Aug 2021 11:31:00 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2e3ef06f-389b-43a0-2125-08d96560514f X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiTwpFlTyQGqvcPFYyI24dYLdl8P1++thyWukzGWuqnuuKLgQowCMQ4yv8PlAUHzAKMYYOvcROjTN27Rpt0cD+YB2l513BksjIWf0tWyXvLwNNiOiBMCl0GBCTUmIsXYYBZ0IGVBInXf6liE4h9XFtTBFeH1wwicfp5uRAumNlEDXJO8XyxJqxL3t6vHUN9j/Zm8S4mKgthlMDP+gMXLa9uko3hXSNXKEdQK0OfPHDFUfNc7XaG47xjJPudcV5Z+a3/qp8gG0yuzDjjDt5W+M5u03aRDoSer4nOTEZU7QnXYMOBwpD99qhKl63Aj0+yIvfHmiK7Nu6pa6OFuH+Yy718zI4SEmB6SY4wU+NutNwIV8sJzd8K/Zi/n9CWAFrHoNucYIY/qpxX4f4gPstgjLPT8ms+EaYw1RII/lMUabjt5/YHUxMQd3Jzkn5LZ6nyywsEPy9pMerYttnkvPmvMEOmV55t/DGwjDsD46ALkMtI57fEVqr5prUhS2jq1TrH6qnzzoE76W6DuBWNw8hi+CBZQH4wiLTV04wU7Z9TwTwqxNpIUguhG/iBPuZ1R+hkeUmNqtOmEfZ1QXQbpwXQ1ut8uAK+JeLuWXw0RP/q/Yc5/wSrHUKr9kFspsW5WKPr6NzDCuzk3VZSiCGMB0SgLwZZMmzs3L+A/CSFwpQK1ZjSUz1099S5A8Hx4j7G11qgkKorygO1Abwnw8JyzUSri+d3PVC7K3MVPowtuD8sNkcSaeiM0fW5WThdZwaCK4hvhDkU= X-MS-TrafficTypeDiagnostic: AM6PR03MB3765: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9kKceeM/RLJ6MAZBPmIdWh5bWihShc9Ux8f786AnVl98mHrbAJKRegLhOZwq+s/0dED4mNvNwJJ4BzfazS4cu2vNstlz0UwzyoPVU8ThOfbtwS9bCepWLFl/zFNAI4/O1pRteZnsw0C+VTWAZzCz2JvHlp+P569oJuHBWWfgVhIjb7OHpRoCe+511QWdGAysbU51L1eIiT+8/McXaK9AetWoAy0C/v4A+WXaHqkuT4Q72LbXuLJBTw+ZVpnnBJDqOoZb+5Q+8utiithk6TOxNY1MrDCPb2RZwPCe1AwJAw8jzmAXwGLEN4WyUrHMgTtiynCIe7YbVRxfCseh9F4OLP8+O7OeohboZ0wGB1zKAmTKyuWV1JvM8YoGabil9KYzH0O1ocTcMCHFeyb2n+V8jlDc2aX2vNW8n+JDENKldcafoz3mHvPSmVGObDtP6sJe X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /GvkWKKm2t4fWnrDuh4QNfcnk36cjRrRdJfsVfrc0My4cRifzwOWZo3ABGI7ONBOSF/ySR024DiKXofv65ETtmdcVhDEHttuoCvr2cTQwngcBTOnngLYUZu5QokWBe7pjmPJd6WCCgmso7Nn2wPXag== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e3ef06f-389b-43a0-2125-08d96560514f X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2021 11:31:00.7282 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB3765 Subject: [FFmpeg-devel] [PATCH 4/5] avformat/utils: Also set io_repositioned for generic seeking X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: g4EljojHoKVr It allows demuxers to perform certain tasks after a successful generic seek. Signed-off-by: Andreas Rheinhardt --- This io_repositioned and the flags which contain which type of seeking a format supports are IMO implementation details that are only public because up until recently there were no internal flags. libavformat/utils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/utils.c b/libavformat/utils.c index 5754fc1537..39f082d98d 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2354,10 +2354,12 @@ static int seek_frame_generic(AVFormatContext *s, int stream_index, ie = &st->internal->index_entries[st->internal->nb_index_entries - 1]; if ((ret = avio_seek(s->pb, ie->pos, SEEK_SET)) < 0) return ret; + s->io_repositioned = 1; avpriv_update_cur_dts(s, st, ie->timestamp); } else { if ((ret = avio_seek(s->pb, s->internal->data_offset, SEEK_SET)) < 0) return ret; + s->io_repositioned = 1; } av_packet_unref(pkt); for (;;) { @@ -2392,6 +2394,7 @@ static int seek_frame_generic(AVFormatContext *s, int stream_index, ie = &st->internal->index_entries[index]; if ((ret = avio_seek(s->pb, ie->pos, SEEK_SET)) < 0) return ret; + s->io_repositioned = 1; avpriv_update_cur_dts(s, st, ie->timestamp); return 0;