[FFmpeg-cvslog] r23175 - in branches/0.6: . cmdutils.c

siretart subversion
Wed May 19 10:03:50 CEST 2010


Author: siretart
Date: Wed May 19 10:03:50 2010
New Revision: 23175

Log:
Make print_error() use strerror() in case av_strerror() fails.

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

Fix roundup issue #1894.

backport r23032 by stefano

Modified:
   branches/0.6/   (props changed)
   branches/0.6/cmdutils.c

Modified: branches/0.6/cmdutils.c
==============================================================================
--- branches/0.6/cmdutils.c	Wed May 19 10:03:22 2010	(r23174)
+++ branches/0.6/cmdutils.c	Wed May 19 10:03:50 2010	(r23175)
@@ -292,6 +292,7 @@ void set_context_opts(void *ctx, void *o
 void print_error(const char *filename, int err)
 {
     char errbuf[128];
+    const char *errbuf_ptr = errbuf;
 
     switch(err) {
 #if CONFIG_NETWORK
@@ -300,8 +301,9 @@ void print_error(const char *filename, i
         break;
 #endif
     default:
-        av_strerror(err, errbuf, sizeof(errbuf));
-        fprintf(stderr, "%s: %s\n", filename, errbuf);
+        if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
+            errbuf_ptr = strerror(AVUNERROR(err));
+        fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
     }
 }
 



More information about the ffmpeg-cvslog mailing list