diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-05-05 21:44:54 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-05-05 21:44:54 +0000 |
commit | 735ef67b9d4f4f9b8d6ebc84c56b00cad56f5b8b (patch) | |
tree | 236841df60770b32f93156994e6e3fb3c9755ee1 /cmdutils.c | |
parent | e2959f455850143272f3455a936dfd4d89ae9e03 (diff) | |
download | ffmpeg-735ef67b9d4f4f9b8d6ebc84c56b00cad56f5b8b.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.
Originally committed as revision 23032 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'cmdutils.c')
-rw-r--r-- | cmdutils.c | 6 |
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); } } |