Commit 735ef67b authored by Stefano Sabatini's avatar Stefano Sabatini

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
parent e2959f45
...@@ -292,6 +292,7 @@ void set_context_opts(void *ctx, void *opts_ctx, int flags) ...@@ -292,6 +292,7 @@ void set_context_opts(void *ctx, void *opts_ctx, int flags)
void print_error(const char *filename, int err) void print_error(const char *filename, int err)
{ {
char errbuf[128]; char errbuf[128];
const char *errbuf_ptr = errbuf;
switch(err) { switch(err) {
#if CONFIG_NETWORK #if CONFIG_NETWORK
...@@ -300,8 +301,9 @@ void print_error(const char *filename, int err) ...@@ -300,8 +301,9 @@ void print_error(const char *filename, int err)
break; break;
#endif #endif
default: default:
av_strerror(err, errbuf, sizeof(errbuf)); if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
fprintf(stderr, "%s: %s\n", filename, errbuf); errbuf_ptr = strerror(AVUNERROR(err));
fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment