aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2012-05-26 00:55:56 +0300
committerMartin Storsjö <martin@martin.st>2012-05-26 13:35:44 +0300
commita1a6cdc26e465fc65e641ab31ef47d263b624568 (patch)
tree9add0061b9518d43f33064a9ee879479f800607f
parent68c813081b48aaa910cd2e7832314a529c4c4a36 (diff)
downloadffmpeg-a1a6cdc26e465fc65e641ab31ef47d263b624568.tar.gz
avconv: Display the error returned by avformat_write_header
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r--avconv.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/avconv.c b/avconv.c
index 5506869d3d..5861f1bbf2 100644
--- a/avconv.c
+++ b/avconv.c
@@ -2863,8 +2863,12 @@ static int transcode_init(void)
for (i = 0; i < nb_output_files; i++) {
oc = output_files[i]->ctx;
oc->interrupt_callback = int_cb;
- if (avformat_write_header(oc, &output_files[i]->opts) < 0) {
- snprintf(error, sizeof(error), "Could not write header for output file #%d (incorrect codec parameters ?)", i);
+ 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);
ret = AVERROR(EINVAL);
goto dump_format;
}