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);
oc->interrupt_callback = int_cb;
if ((ret = avformat_write_header(oc, &output_files[i]->opts)) < 0) {
char errbuf[128];
- const char *errbuf_ptr = errbuf;
- if (av_strerror(ret, errbuf, sizeof(errbuf)) < 0)
- errbuf_ptr = strerror(AVUNERROR(ret));
- snprintf(error, sizeof(error), "Could not write header for output file #%d (incorrect codec parameters ?): %s", i, errbuf_ptr);
+ av_strerror(ret, errbuf, sizeof(errbuf));
+ snprintf(error, sizeof(error),
+ "Could not write header for output file #%d "
+ "(incorrect codec parameters ?): %s",
+ i, errbuf);
ret = AVERROR(EINVAL);
goto dump_format;
}