Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/3] fftools/cmdutils: Use av_err2str
@ 2022-10-04 14:40 Marvin Scholz
  2022-10-04 14:40 ` [FFmpeg-devel] [PATCH 2/3] fftools/ffprobe: " Marvin Scholz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Marvin Scholz @ 2022-10-04 14:40 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Marvin Scholz

av_err2str which is a wrapper for av_strerror already calls
strerror_r if available and if not has a fallback for the other
error codes that would be handled by that, so manually calling
strerror again if it fails is not necessary.
---
 fftools/cmdutils.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index f911c52be2..beef8ce385 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -798,12 +798,7 @@ do {                                                                           \
 
 void print_error(const char *filename, int err)
 {
-    char errbuf[128];
-    const char *errbuf_ptr = errbuf;
-
-    if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
-        errbuf_ptr = strerror(AVUNERROR(err));
-    av_log(NULL, AV_LOG_ERROR, "%s: %s\n", filename, errbuf_ptr);
+    av_log(NULL, AV_LOG_ERROR, "%s: %s\n", filename, av_err2str(err));
 }
 
 int read_yesno(void)
-- 
2.37.0 (Apple Git-136)

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-13 14:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-04 14:40 [FFmpeg-devel] [PATCH 1/3] fftools/cmdutils: Use av_err2str Marvin Scholz
2022-10-04 14:40 ` [FFmpeg-devel] [PATCH 2/3] fftools/ffprobe: " Marvin Scholz
2022-10-04 14:40 ` [FFmpeg-devel] [PATCH 3/3] fftools/ffmpeg_opt: " Marvin Scholz
2022-10-13 14:50 ` [FFmpeg-devel] [PATCH 1/3] fftools/cmdutils: " Anton Khirnov

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git