[FFmpeg-cvslog] ffmpeg: improve feedback when processing filtergraph events

Stefano Sabatini git at videolan.org
Sun Sep 25 22:47:27 CEST 2011


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Sat Sep 24 13:57:26 2011 +0200| [01fbcc6fd677226d7c3f1beb7532ef35da5b78c9] | committer: Stefano Sabatini

ffmpeg: improve feedback when processing filtergraph events

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=01fbcc6fd677226d7c3f1beb7532ef35da5b78c9
---

 ffmpeg.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 039f629..19b82ff 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2412,14 +2412,17 @@ static int transcode(OutputFile *output_files, int nb_output_files,
             if (key == 'c' || key == 'C'){
                 char buf[4096], target[64], command[256], arg[256] = {0};
                 double time;
-                int k;
+                int k, n = 0;
                 fprintf(stderr, "\nEnter command: <target> <time> <command>[ <argument>]\n");
                 i = 0;
                 while ((k = read_key()) != '\n' && k != '\r' && i < sizeof(buf)-1)
                     if (k > 0)
                         buf[i++] = k;
                 buf[i] = 0;
-                if (k > 0 && sscanf(buf, "%63[^ ] %lf %255[^ ] %255[^\n]", target, &time, command, arg) >= 3) {
+                if (k > 0 &&
+                    (n = sscanf(buf, "%63[^ ] %lf %255[^ ] %255[^\n]", target, &time, command, arg)) >= 3) {
+                    av_log(NULL, AV_LOG_DEBUG, "Processing command target:%s time:%f command:%s arg:%s",
+                           target, time, command, arg);
                     for (i = 0; i < nb_output_streams; i++) {
                         ost = &output_streams[i];
                         if (ost->graph) {
@@ -2433,7 +2436,9 @@ static int transcode(OutputFile *output_files, int nb_output_files,
                         }
                     }
                 } else {
-                    fprintf(stderr, "Parse error\n");
+                    av_log(NULL, AV_LOG_ERROR,
+                           "Parse error, at least 3 arguments were expected, "
+                           "only %d given in string '%s'\n", n, buf);
                 }
             }
 #endif



More information about the ffmpeg-cvslog mailing list