ffmpeg: be more verbose when printing an error in transcode()
authorStefano Sabatini <stefasab@gmail.com>
Fri, 1 Jun 2012 16:24:02 +0000 (18:24 +0200)
committerStefano Sabatini <stefasab@gmail.com>
Sun, 3 Jun 2012 22:55:08 +0000 (00:55 +0200)
Helps debuggability.

ffmpeg.c

index 9511a6b..24b54ed 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3577,10 +3577,12 @@ static int transcode(void)
         }
 
         // fprintf(stderr,"read #%d.%d size=%d\n", ist->file_index, ist->st->index, pkt.size);
-        if (output_packet(ist, &pkt) < 0 ||
+        if ((ret = output_packet(ist, &pkt)) < 0 ||
             ((ret = poll_filters()) < 0 && ret != AVERROR_EOF)) {
-            av_log(NULL, AV_LOG_ERROR, "Error while decoding stream #%d:%d\n",
-                   ist->file_index, ist->st->index);
+            char buf[128];
+            av_strerror(ret, buf, sizeof(buf));
+            av_log(NULL, AV_LOG_ERROR, "Error while decoding stream #%d:%d: %s\n",
+                   ist->file_index, ist->st->index, buf);
             if (exit_on_error)
                 exit_program(1);
             av_free_packet(&pkt);