aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2010-05-19 08:03:50 +0000
committerReinhard Tartler <siretart@tauware.de>2010-05-19 08:03:50 +0000
commite0e0283778043220e25ca050f5bbd549ab570c6f (patch)
treecdb11d6a2324fb8c6524ce279b819d7f4dd1b991
parent1673bf86d6390cb3f7aaaae115264afa1dc41a14 (diff)
downloadffmpeg-e0e0283778043220e25ca050f5bbd549ab570c6f.tar.gz
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 Originally committed as revision 23175 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
-rw-r--r--cmdutils.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmdutils.c b/cmdutils.c
index e6efc491d7..d02b36e66e 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -292,6 +292,7 @@ void set_context_opts(void *ctx, void *opts_ctx, int flags)
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, 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)
+ errbuf_ptr = strerror(AVUNERROR(err));
+ fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
}
}