From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id E37204C170
	for <ffmpegdev@gitmailbox.com>; Tue,  1 Apr 2025 23:46:16 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9BC84687DB5;
	Wed,  2 Apr 2025 02:45:27 +0300 (EEST)
Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com
 [209.85.128.42])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A9FB3687D9F
 for <ffmpeg-devel@ffmpeg.org>; Wed,  2 Apr 2025 02:45:19 +0300 (EEST)
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-43cf3192f3bso61221935e9.1
 for <ffmpeg-devel@ffmpeg.org>; Tue, 01 Apr 2025 16:45:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743551119; x=1744155919; darn=ffmpeg.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=GS2zVlN1If3Me+AXZa5Yp68ZxYyMZ4z6Ug+8pgyPhcY=;
 b=WB4/dnAPxdc2clZ3X9xwLKilv6DeTpMpcdVh2KNR8aMBlQOQW7oz8dbjq6yiMnsKnz
 ++on1jF3TSna+/VzjE3mRCgZ55X+6jNWZjSSjBEOZXF7pYXthSCDrYok9Ivs6w6Qz7AP
 +K0VAMF7tPIfPpiDDXQu+WkjdQQ7H43tJXN9nnhzSh1W8JDZ++1xN3+Eho57BxSTXEqe
 45hKdQy3/nsVD71I0P4Vo0xDKymBm+FG9dSgWohFbZJp/rhi+ti14YezBxZfgSfD1agw
 YIuRWy2J+FeKcYGW/yKod8GWWPtkuWm3JONALU77jWFfqAGunr521R36nUpKzsX6aNSL
 t1MQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743551119; x=1744155919;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=GS2zVlN1If3Me+AXZa5Yp68ZxYyMZ4z6Ug+8pgyPhcY=;
 b=a6+ckGppT+hnd2tNdBFpiWjF2gQletBGx7/r+pcu9YuU1DhsVzzdVnxfJXapiXf6RN
 2ghOdepp9Sj3mYogHCbRG5fSP1kIdXqcb+yBB2l+GFIoIEr5ksDAE44E6vM/asqjtN4c
 AX1ksF8MeQLrzBW2sZ/Ipumcm4rJ/N1WLDsQe3yFkm4SQvIUMwRgD9IsJCHGaGBe2k0q
 xTPzey9yTHKzhXH7agOR3BTM4kIvNgxU5earWMWPjifQEO4nKikY8QUw2hKntbEh2l6j
 kekJnwwIjTWvxBYVHo8QNR1MF2medkbJ8FWUwSSfgUFlmDmrwOc/dRtlJk+VzoEpkaLg
 HIkA==
X-Gm-Message-State: AOJu0Yyco3XWRX+NinQslWLGfVX38dRnO/o8MEpsfY2Bgz7zn5i3qbol
 tyDdT2Ira1DVqfS5iatcGUmkN+YHKPY6SO/tDQdkV3J79kNKvrfDXOwPtA==
X-Gm-Gg: ASbGncutMycN1sUB4jWDPqoj8wZg/KzzL7+oi70FcQp9xj0yqvizRRr/jX8WfKseiLR
 rHaZgT5lP16NVzWnoFLh6qtL4hTs5lWYnpRmzKnnxjDpVqCoeq++NPHXmmnmAIDb1QOkVKunXnP
 6hlyJaPnZVgCNB1FsezhVbNMW1CqWeTXgggydbMoGnkX2O+6+YZUvNu45xufbufVcbk7ns+zALB
 gJqR3T+RpxRUEblY5j+AVkSJMfRlP+R1X6YAQjV7ImwssnB2H+nVqCuwbbk15PqUmG1c9knYBUf
 VpI6HueHi39fqdiLSmKZK1SwMHlBDp4jQAYuw0660ylJFDasnozq1Pe5aEpWQBjfWckqJeRFlcK
 IawI6B6c5bXIy5bsDpmLLCsimd30bvNcjAxiW2SVi4lpcxh7Qtuu7rXaRRPTGng==
X-Google-Smtp-Source: AGHT+IF7+nDxOac7ZomHPpzx2oQFlD0bdvCgRI4sxvAjRSdthlKixDSXbSQxiZXj3892Zr/UhVC48w==
X-Received: by 2002:a05:600c:244:b0:43d:fa59:a684 with SMTP id
 5b1f17b1804b1-43dfa59a7ebmr89071815e9.32.1743551118927; 
 Tue, 01 Apr 2025 16:45:18 -0700 (PDT)
Received: from ArmedBeast.fritz.box
 (p200300cccf1b51005576e6fda25978ed.dip0.t-ipconnect.de.
 [2003:cc:cf1b:5100:5576:e6fd:a259:78ed])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-39c0b7a420bsm15128993f8f.82.2025.04.01.16.45.15
 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);
 Tue, 01 Apr 2025 16:45:17 -0700 (PDT)
From: Marvin Scholz <epirat07@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Date: Wed,  2 Apr 2025 01:43:34 +0200
Message-Id: <20250401234336.35650-5-epirat07@gmail.com>
X-Mailer: git-send-email 2.39.5 (Apple Git-154)
In-Reply-To: <20250401234336.35650-1-epirat07@gmail.com>
References: <20250401234336.35650-1-epirat07@gmail.com>
MIME-Version: 1.0
Subject: [FFmpeg-devel] [PATCH 5/7] tools/ismindex: use av_err2str
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>
Cc: Marvin Scholz <epirat07@gmail.com>
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>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/20250401234336.35650-5-epirat07@gmail.com/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

There is no need to explicitly specify the buffer, as it
is only ever passed to fprintf, so av_err2str can be used.
---
 tools/ismindex.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/tools/ismindex.c b/tools/ismindex.c
index 6fe68d8a79..b110420bf0 100644
--- a/tools/ismindex.c
+++ b/tools/ismindex.c
@@ -149,9 +149,7 @@ static int write_fragment(const char *filename, AVIOContext *in)
     int ret;
 
     if ((ret = avio_open2(&out, filename, AVIO_FLAG_WRITE, NULL, NULL)) < 0) {
-        char errbuf[100];
-        av_strerror(ret, errbuf, sizeof(errbuf));
-        fprintf(stderr, "Unable to open %s: %s\n", filename, errbuf);
+        fprintf(stderr, "Unable to open %s: %s\n", filename, av_err2str(ret));
         return ret;
     }
     ret = copy_tag(in, out, MKBETAG('m', 'o', 'o', 'f'));
@@ -500,20 +498,18 @@ static int handle_file(struct Tracks *tracks, const char *file, int split,
 {
     AVFormatContext *ctx = NULL;
     int err = 0, i, orig_tracks = tracks->nb_tracks;
-    char errbuf[50], *ptr;
+    char *ptr;
     struct Track *track;
 
     err = avformat_open_input(&ctx, file, NULL, NULL);
     if (err < 0) {
-        av_strerror(err, errbuf, sizeof(errbuf));
-        fprintf(stderr, "Unable to open %s: %s\n", file, errbuf);
+        fprintf(stderr, "Unable to open %s: %s\n", file, av_err2str(err));
         return 1;
     }
 
     err = avformat_find_stream_info(ctx, NULL);
     if (err < 0) {
-        av_strerror(err, errbuf, sizeof(errbuf));
-        fprintf(stderr, "Unable to identify %s: %s\n", file, errbuf);
+        fprintf(stderr, "Unable to identify %s: %s\n", file, av_err2str(err));
         goto fail;
     }
 
-- 
2.39.5 (Apple Git-154)

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".