diff mbox series

[FFmpeg-devel,1/3] fftools/cmdutils: Use av_err2str

Message ID 20221004144008.89188-1-epirat07@gmail.com
State Accepted
Commit 3eab2c1af11bea8e7cac52433161d40316df55a8
Headers show
Series [FFmpeg-devel,1/3] fftools/cmdutils: Use av_err2str | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Marvin Scholz Oct. 4, 2022, 2:40 p.m. UTC
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(-)

Comments

Anton Khirnov Oct. 13, 2022, 2:50 p.m. UTC | #1
Patchset looks good, will push.
diff mbox series

Patch

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)