[FFmpeg-cvslog] Fix parsing of -force_key_frames option.

Reimar Döffinger git at videolan.org
Tue May 1 00:03:49 CEST 2012


ffmpeg | branch: master | Reimar Döffinger <Reimar.Doeffinger at gmx.de> | Mon Apr 30 22:48:42 2012 +0200| [4f6a1c974ff69afa5b40ced0c9e39c90da73235a] | committer: Reimar Döffinger

Fix parsing of -force_key_frames option.

Currently it always exits with an error when more than
one position is specified.
Fixes trac issue #1266.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>

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

 ffmpeg.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index abceb3f..37817cc 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -4380,9 +4380,12 @@ static void parse_forced_key_frames(char *kf, OutputStream *ost)
         av_log(NULL, AV_LOG_FATAL, "Could not allocate forced key frames array.\n");
         exit_program(1);
     }
+    p = kf;
     for (i = 0; i < n; i++) {
-        p = i ? strchr(p, ',') + 1 : kf;
+        char *next = strchr(p, ',');
+        if (next) *next++ = 0;
         ost->forced_kf_pts[i] = parse_time_or_die("force_key_frames", p, 1);
+        p = next;
     }
 }
 



More information about the ffmpeg-cvslog mailing list