summaryrefslogtreecommitdiff
path: root/avconv.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-06-20 00:06:08 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-06-22 20:54:59 +0200
commit42cc6cefd315c1556e2a52f7ebe2f766ec82b790 (patch)
treec0e33bcb649183bf7f13bf273d40b7586bfec0b0 /avconv.c
parent1e340af8d6a97cc013a2ad8ba77c77129625a34f (diff)
avconv: report the error for codec open failure
External codec may have corner case reason to fail at init, better report them instead having the user wonder.
Diffstat (limited to 'avconv.c')
-rw-r--r--avconv.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/avconv.c b/avconv.c
index b490d4aa4a..9fa0675690 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1371,10 +1371,16 @@ static int init_input_stream(int ist_index, char *error, int error_len)
if (!av_dict_get(ist->opts, "threads", NULL, 0))
av_dict_set(&ist->opts, "threads", "auto", 0);
if ((ret = avcodec_open2(ist->st->codec, codec, &ist->opts)) < 0) {
+ char errbuf[128];
if (ret == AVERROR_EXPERIMENTAL)
abort_codec_experimental(codec, 0);
- snprintf(error, error_len, "Error while opening decoder for input stream #%d:%d",
- ist->file_index, ist->st->index);
+
+ av_strerror(ret, errbuf, sizeof(errbuf));
+
+ snprintf(error, error_len,
+ "Error while opening decoder for input stream "
+ "#%d:%d : %s",
+ ist->file_index, ist->st->index, errbuf);
return ret;
}
assert_avoptions(ist->opts);