From patchwork Sun Jun 30 10:33:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 50219 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cc64:0:b0:482:c625:d099 with SMTP id k4csp1201317vqv; Sun, 30 Jun 2024 03:33:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVcYgzBOlRVPtUVJ7QOWtuioq+Rj57H+JP5ElfEYm4G/86k3UNC7mgxpljzkbDatn658CUtLO1FG6ISX8HD9F56PBInryA/UJpUzw== X-Google-Smtp-Source: AGHT+IFkaEkg7O/opiAA63TyvdD8ASVUNNUPZWmqaOCXptwg4LhNGDExUHj6LhbjoIcztIZzlBZi X-Received: by 2002:a05:6402:3491:b0:57a:1fef:619e with SMTP id 4fb4d7f45d1cf-5879f59bbdcmr2166837a12.18.1719743625408; Sun, 30 Jun 2024 03:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719743625; cv=none; d=google.com; s=arc-20160816; b=fq4N5Pr3DukOoEBlR3IXjpotzpqnloy/r64BG6iMlNqTvB8gfJtCx5HAQrbsqeWXon /irt3qk7FUlJUgh0OA/fvqSstWMN1z7lwenJhPccblwOdtVBvUBpX9ciZZtpOewX0Kev tUgUuMcO6/4GYRnGoJK3KVOtvCT6mnd4CZ5BqyafpM2QTTI9+ye/cvDZ3BpDh8pYGpFh AMSaBtAenRkoQdLe37romznrHrBp2XXmooT62tszTpKTt6JfvEbkHuZY02zwqKrZBfjw lmI152s6RmkmXgom8bwFpiZLNj4gyO+ml8vaRM/MYCbCLeiQj87dQqx35rOkuHJWm1rD +Rmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to:date :to:from:message-id:dkim-signature:delivered-to; bh=ksHJbOV7e50jsEMpmdQYyVI5hZPFKahN9+w7BVmRNaY=; fh=HnHYuZ9XgUo86ZRXTLWWmQxhslYEI9B9taZ5X1DLFfc=; b=fT3t7iLybsMeZUTCm2Do3O0OMQTV1UGbkNfenXG3HBERuF+omrxEAmMWYf/buF7GKN 7tZMDsHTMjA5TkcngqKfKRRrYMseRkFvkqrQUeZUB9THU17l8fs+gtFFYWrLHSwPPLeG L5rU0TLYpOl6fk4b045NPou73GZqwqqLs7as4cTtUWdGRAPIuFEKMAVhl2NAZo/Xqz3Z BZCZYpGsk+fOR1KofqYv0Lf57snHTmA3XHb7W7f2C94nB2/tZAdvrAPcByXoisCAiCpX bbUNmiCZs3I3MJ0ZIFco7tF5RzeIxojzCItekHAGPhAIKsObmdv3zO2nprVQ23luOFTr WWBA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@foxmail.com header.s=s201512 header.b="la3VO8G/"; 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=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4fb4d7f45d1cf-586137207f4si2608178a12.23.2024.06.30.03.33.44; Sun, 30 Jun 2024 03:33:45 -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=@foxmail.com header.s=s201512 header.b="la3VO8G/"; 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=NONE dis=NONE) header.from=foxmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D07A668D2B0; Sun, 30 Jun 2024 13:33:41 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out203-205-251-36.mail.qq.com (out203-205-251-36.mail.qq.com [203.205.251.36]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CFEB268D37F for ; Sun, 30 Jun 2024 13:33:32 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1719743603; bh=wgNr696X8qe7EuloAFSgdBsN6+kR91vqFeP4QH4gfjk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=la3VO8G/XYnm5cCcctCc3i3gqf6DbAZWS0iiyNloVpzKA+KT3u39BbinNj0hi56fS Q1XKuk9cbZZaiUGWWZ2Nfz56i87PbE45bHhWFO7qRr8UfScRMZ1vnIAkWeVHzq+hpc Q6Yp9daNY6rO9K1nF9IsjE018yvzkLCoS0CAWBVY= Received: from ZHILIZHAO-MB1.tencent.com ([121.34.202.77]) by newxmesmtplogicsvrszc5-2.qq.com (NewEsmtp) with SMTP id 854A7CEE; Sun, 30 Jun 2024 18:33:20 +0800 X-QQ-mid: xmsmtpt1719743601tzbpsjejq Message-ID: X-QQ-XMAILINFO: MyirvGjpKb1jT8r64tu78GcznoMBerDumzuHLB+sUzzygWz2TxAELwp7BZbqbC 7aei1fFAYZU4DxB6n7+SCDHnzdkFI7q4/Tp0nZ9bkfwN4Kq1XIy06RbK2AfLz+KzkLN+ozgD+56t GZmpdi1RAPVt1LKyX3sa9envs/JjPW4DMXjyV56WrITmmrehJY0XgQ8va9jfl1J5Vr5Uu8nMy0WR ZRuDOZFsQ4yo83KlFTGqsWSAEa24qHfiXocLFyRnULlMMKMlJNABDivi7u5Du0OT+YlD5u8dxYFL dMH7aJm36YpxHQYfKegEvg4Gi/9zWzHq1licY15LmOafaM1LpVV1vktKzNFQu8Qr0D5dA6//LPyG mrzipaAGtydgsq3ZrS6TxURk05+SgE1ifyGQgcTfG27dUgCPlwCw45hqeUiqQdcXbYn2mY752hC2 GOqEuOPFcpJZM115Z170f/T7JWggPjSFdn5IX7KNCWOVqU721MP6EFceAKV43mx/wbEhDY4dQeF/ ROzHU4m3kfiqRwarUCydzwkwtrbod5ulEl6rYW1JBMGDCaJhWrx0S/LNoxptBkjAQtJi52Zv/TOe B+1Zoah4R5riiHdrEnRQ5o45tPfeXgsLjEChYvgtdklQ99WZ9bxF6gRgEddfoMA3iO7yZbqHkK20 EMU5PTXxpD7pvgNuRx/siI2uP35KH2OWQXLy8Nom+qmUEEMQeD+FtesS/dNRi8abomAXrOFOl10R DdqaWpm3IBgDfveYS9tDBxoCa2UqVOjJ+Y7fThROy6PFkjqpdRBsRGQ8K1v6XHuWoWWccXXHuuQo E+TjnJejdkKweoiTU8/CXSKwvLpDemCpbn9bi8caCnOfe8WOzi0TiKrwDSM48u5HilH8VQFXaLts 66RghYqXwFOMllRpj4Bu6Qv2+C4PYrbboA2J4+KscP1nWFrZq6qK1rai/NprBFiGzm4J14VVRlNt QHGY26G0qD3hW8utgCPBWYLfEE/bmOxwtztdd0oVw= X-QQ-XMRINFO: MPJ6Tf5t3I/ycC2BItcBVIA= From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Sun, 30 Jun 2024 18:33:19 +0800 X-OQ-MSGID: <20240630103319.94068-2-quinkblack@foxmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240630103319.94068-1-quinkblack@foxmail.com> References: <20240630103319.94068-1-quinkblack@foxmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 2/2] avformat/file: guard fd_dup by FD_PROTOCOL or PIPE_PROTOCOL 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: Zhao Zhili Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: hTvV/0wVZaSw From: Zhao Zhili fd_dup is unused when fd and pipe have been disabled. This also fix build error with wasi since 'dup' isn't available. Signed-off-by: Zhao Zhili --- libavformat/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/file.c b/libavformat/file.c index 3fc1e741f2..6a66040b65 100644 --- a/libavformat/file.c +++ b/libavformat/file.c @@ -193,6 +193,7 @@ static int file_check(URLContext *h, int mask) return ret; } +#if CONFIG_FD_PROTOCOL || CONFIG_PIPE_PROTOCOL static int fd_dup(URLContext *h, int oldfd) { int newfd; @@ -215,6 +216,7 @@ static int fd_dup(URLContext *h, int oldfd) #endif return newfd; } +#endif static int file_close(URLContext *h) {