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

Reimar Döffinger git at libav.org
Sat Oct 6 08:48:09 CEST 2012


Module: libav
Branch: release/0.8
Commit: 8efae4cbbf510588920d81b7e84d6e80ff1226df

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
(cherry picked from commit 4c679750cb4cb112c19f862bd733bf6660a935bd)

Signed-off-by: Anton Khirnov <anton at khirnov.net>

---

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

diff --git a/avconv.c b/avconv.c
index 718fc8d..90bc49c 100644
--- a/avconv.c
+++ b/avconv.c
@@ -2247,10 +2247,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-commits mailing list