[libav-stable] avconv: fix parsing of -force_key_frames option.

Reimar Döffinger git at libav.org
Thu Jul 5 14:56:37 CEST 2012


Module: libav
Branch: master
Commit: 4c679750cb4cb112c19f862bd733bf6660a935bd

Author:    Reimar Döffinger <Reimar.Doeffinger at gmx.de>
Committer: Anton Khirnov <anton at khirnov.net>
Date:      Mon Apr 30 22:48:42 2012 +0200

avconv: fix parsing of -force_key_frames option.

Currently it always exits with an error when more than
one position is specified.

CC: libav-stable at libav.org

---

 avconv.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/avconv.c b/avconv.c
index 9613567..6517c4b 100644
--- a/avconv.c
+++ b/avconv.c
@@ -2350,10 +2350,18 @@ 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;
+
         t = parse_time_or_die("force_key_frames", p, 1);
         ost->forced_kf_pts[i] = av_rescale_q(t, AV_TIME_BASE_Q, avctx->time_base);
+
+        p = next;
     }
 }
 



More information about the libav-stable mailing list