Message ID | D41CE2FHWEWO.181P7GYSH41C5@gmail.com |
---|---|
State | Accepted |
Headers | show
Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9c4f:0:b0:48e:c0f8:d0de with SMTP id w15csp1369570vqu; Sun, 8 Sep 2024 18:39:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWEf0ad+b4bogEl6rgKLVQq/y8Sj+RwoKOwZEdshfsMPYF3AyToSM4eN5itd0dCjYpicNACBbpv/MDRorcf0yN0@gmail.com X-Google-Smtp-Source: AGHT+IEAs5mYLvZUhhhiXdCWWfZMa4LKNwknU/onlatyV/2JoEcuBH2yteWGzihyKnEDOoLbSCMN X-Received: by 2002:a05:6512:2391:b0:52e:fb8b:32d0 with SMTP id 2adb3069b0e04-536587e0078mr3207560e87.1.1725845953379; Sun, 08 Sep 2024 18:39:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725845953; cv=none; d=google.com; s=arc-20240605; b=KCOMCyPgnGZ2tFgM1vjQxCJLec3dIQumOrpvp35P680CRiikMeLt/WYf2IKoBn+X9D CA2YZQChO9yCTO8O7xCPEmkNkWVfiX6fzx8CIwS/4DlwyMkzgRV0lombLhwp8pXLKML9 94PYgC0md4SUAaNC//HdjTTF8pF8vS/myfXiDRsaxclgJJ0ZCwpwMNNdVJFtcmxcDbOR zPiLcw84aIf72qOgxx64FSH+CEB3UKQIVCR7H39eJwITKUWNYW4K82rZ3dgjJHyR/3lL IA50A5WqqOUl7g3CT5gK4GUgyIofR9JpaDXudsK/jsIsF/FGaNYsXT75VOycGEeVYLEm iBVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:date:from:to:message-id:in-reply-to :dkim-signature:delivered-to; bh=pGucN0PxFbjwvDzwiQXUgGyup1j/2BP5OwskMaqNBFs=; fh=5IeVwzS1vbVKjIV8MP3mnmnRtZGb8uteQ9r4QD2keV0=; b=OSx8bNZ1NwPl7is4kxaMoe6NFMBMVmz/Hfu1A2PVyNXpcvhf1LRSbbt9ojCpARIxWC FJfNJN1gS/J2xG9LjEYGQW7H5juHT/0DY+kUpWRXYlEImxo787S5FKOnFWgBc5k1By4h HO8NEEJzbI3IlTFyfEQlDY5Pm9hdBmFwg+bPvIb3X7IGNvm0DLfhwfOGp/9zsREU6phx 9W77qaJKNLhXHCs8kLwnsHAhDhpM8N2LOwnlgS+DaE0RhyNwdIhRP3tBnj9mYa0Z4ENP HZ6cThTCCLWBe5BuUA6DfVlmiB0nmgcW0tQV6EV7H4UbzfYXlsHtSA2huO5yk1IZ//gl SzcA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=GqQlAnub; 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=gmail.com; dara=fail header.i=@gmail.com Return-Path: <ffmpeg-devel-bounces@ffmpeg.org> Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 2adb3069b0e04-5365f8c160fsi1304463e87.319.2024.09.08.18.39.12; Sun, 08 Sep 2024 18:39:13 -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=@gmail.com header.s=20230601 header.b=GqQlAnub; 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=gmail.com; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0B93A68DC67; Mon, 9 Sep 2024 03:55:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DBC3768DB68 for <ffmpeg-devel@ffmpeg.org>; Mon, 9 Sep 2024 03:55:18 +0300 (EEST) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-42cb57f8b41so8006745e9.0 for <ffmpeg-devel@ffmpeg.org>; Sun, 08 Sep 2024 17:55:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725843318; x=1726448118; darn=ffmpeg.org; h=subject:date:from:to:message-id:in-reply-to:from:to:cc:subject:date :message-id:reply-to; bh=QZLfknP8JyH/f35KQeNolIdGJWqvkmbls2aAUPyW9Og=; b=GqQlAnubmFAL1tDjMFDJt45k7cShWElgRnyKQJ9DyHhc0V6ZiqVbpTyqCDfDlh8psJ 6aQhj29IpA0ASuzX1XOVyQ2GlgP4myMHd2Do5WT76QmfVZYHd8psRv08B1XhF9BaPTUQ 0nKaO1fZSihQCAqLvToGRnSrejPurc908cElKj0kw+8or2jhJ20evVf3kJM3zz7Wzhx6 OO/y9Jn8gNXJLm8vhgdHwxd5HWBFtbGdEa++oEu5kzjPKzQ3ECTVfbPCll2AqxwkCV+w 2h5ebWQ27GgIpXD+Oq4GkWvS4xewmXS1sYDDh+6kxuxUdIVn6ZlThbyoIRy7y1xRiYpa nSXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725843318; x=1726448118; h=subject:date:from:to:message-id:in-reply-to:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=QZLfknP8JyH/f35KQeNolIdGJWqvkmbls2aAUPyW9Og=; b=cZbqB9CUk6B/KLz64W1xFQ1yziwfElqqbluIuth7/LDubHuiV2opS3ElTFwGz2HR+7 jsq2wFislkXOGL9PB0wr4gmHjNTpupjaH0v47emIMBZk2hhpEmJXKQ6VmH8HeEVWzayS kYp6vpY74xP/LCr7Fwe0zkkSb1kdGOm/b8Wq0N+EuQKTjhpemghPDBvyBneRlHXTpQ8R ZJyid2S6LHbrCbSfSr/aTFza0aGkBzyfwcS+GtaTb62rcR8Tx22olL/Bf0HR1g18Af1H yQngy1TbA6JJUXUHGlewAl+D9BB/YTv1EjyWXqB3l9GwbIlHG+8HISPpXJulleJLwfM7 fOMg== X-Gm-Message-State: AOJu0YxeIQx1u0OjoHk2hb5xWUUGx/ypaywsw7S6rAgJoYddhXomPJVk 32bqqyqteYK46QiT665+PhxgoXCkiX7tvPzEmGab23OLDodjuzZW8cGCIA== X-Received: by 2002:adf:e949:0:b0:374:bd48:fae8 with SMTP id ffacd0b85a97d-378922b691amr5064938f8f.25.1725843318138; Sun, 08 Sep 2024 17:55:18 -0700 (PDT) Received: from localhost (p200300cccf1178009d94fda8472792f7.dip0.t-ipconnect.de. [2003:cc:cf11:7800:9d94:fda8:4727:92f7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895649728sm4583399f8f.16.2024.09.08.17.55.17 for <ffmpeg-devel@ffmpeg.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 Sep 2024 17:55:17 -0700 (PDT) In-Reply-To: <D41CE2FHUKJS.3JT42UG2S21VV@gmail.com> Message-Id: <D41CE2FHWEWO.181P7GYSH41C5@gmail.com> To: <ffmpeg-devel@ffmpeg.org> From: "Marvin Scholz" <epirat07@gmail.com> Date: Sun, 8 Sep 2024 21:43:39 +0200 Subject: [FFmpeg-devel] [PATCH 18/60] avutil/file: use av_err2str to simplify code X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org> List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe> List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel> List-Post: <mailto:ffmpeg-devel@ffmpeg.org> List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help> List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe> Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org> X-TUID: 8wD1orURiyRF |
Series |
[FFmpeg-devel,01/60] fftools/ffmpeg_opt: fix variable shadowing
|
expand
|
Quoting Marvin Scholz (2024-09-08 21:43:39) > No need to explicitly specify the buffer here as it is only > ever passed to av_log, so av_err2str can be used. > --- > libavutil/file.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) Looks ok
diff --git a/libavutil/file.c b/libavutil/file.c index 2d1063b6a2..db8507286b 100644 --- a/libavutil/file.c +++ b/libavutil/file.c @@ -60,21 +60,18 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, struct stat st; av_unused void *ptr; off_t off_size; - char errbuf[128]; *bufptr = NULL; *size = 0; if (fd < 0) { err = AVERROR(errno); - av_strerror(err, errbuf, sizeof(errbuf)); - av_log(&file_log_ctx, AV_LOG_ERROR, "Cannot read file '%s': %s\n", filename, errbuf); + av_log(&file_log_ctx, AV_LOG_ERROR, "Cannot read file '%s': %s\n", filename, av_err2str(err)); return err; } if (fstat(fd, &st) < 0) { err = AVERROR(errno); - av_strerror(err, errbuf, sizeof(errbuf)); - av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in fstat(): %s\n", errbuf); + av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in fstat(): %s\n", av_err2str(err)); close(fd); return err; } @@ -97,8 +94,7 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, ptr = mmap(NULL, *size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); if (ptr == MAP_FAILED) { err = AVERROR(errno); - av_strerror(err, errbuf, sizeof(errbuf)); - av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in mmap(): %s\n", errbuf); + av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in mmap(): %s\n", av_err2str(err)); close(fd); *size = 0; return err;