[PATCH 2/3] Make print_error() use strerror() in case av_strerror() fails.

Stefano Sabatini stefano.sabatini-lala
Mon May 3 23:36:21 CEST 2010


Should provide a meaningful error message for systems which do not
support strerror_r().

Fix roundup issue #1894.
---
 cmdutils.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/cmdutils.c b/cmdutils.c
index e6efc49..0de1d2d 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -300,8 +300,10 @@ void print_error(const char *filename, int err)
         break;
 #endif
     default:
-        av_strerror(err, errbuf, sizeof(errbuf));
-        fprintf(stderr, "%s: %s\n", filename, errbuf);
+        if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
+            fprintf(stderr, "%s: %s\n", filename, strerror(AVUNERROR(err)));
+        else
+            fprintf(stderr, "%s: %s\n", filename, errbuf);
     }
 }
 
-- 
1.7.0


--J2SCkAp4GZ/dPZZf--



More information about the ffmpeg-devel mailing list