[FFmpeg-devel] [PATCH] Fix parsing of -force_key_frames option.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Apr 30 22:50:00 CEST 2012


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>
---
 ffmpeg.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 6efa12c..8ee825d 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -4379,9 +4379,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;
     }
 }
 
-- 
1.7.10



More information about the ffmpeg-devel mailing list