[FFmpeg-cvslog] ffmpeg: cosmetics -- move parse_forced_key_frames().

Anton Khirnov git at videolan.org
Tue Aug 30 18:15:00 CEST 2011


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Tue Aug 30 04:14:12 2011 +0200| [c692eda3e707c03ff9b050f95621897a59284115] | committer: Michael Niedermayer

ffmpeg: cosmetics -- move parse_forced_key_frames().

parse_forced_key_frames() is only used in new_video_stream(), so move it
right above new_video_stream().

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

 ffmpeg.c |   46 +++++++++++++++++++++++-----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index ceade11..91fafa4 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2026,29 +2026,6 @@ static int copy_chapters(int infile, int outfile)
     return 0;
 }
 
-static void parse_forced_key_frames(char *kf, OutputStream *ost,
-                                    AVCodecContext *avctx)
-{
-    char *p;
-    int n = 1, i;
-    int64_t t;
-
-    for (p = kf; *p; p++)
-        if (*p == ',')
-            n++;
-    ost->forced_kf_count = n;
-    ost->forced_kf_pts = av_malloc(sizeof(*ost->forced_kf_pts) * n);
-    if (!ost->forced_kf_pts) {
-        av_log(NULL, AV_LOG_FATAL, "Could not allocate forced key frames array.\n");
-        exit_program(1);
-    }
-    for (i = 0; i < n; i++) {
-        p = i ? strchr(p, ',') + 1 : kf;
-        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);
-    }
-}
-
 /*
  * The following code is the main loop of the file converter
  */
@@ -3401,6 +3378,29 @@ static int opt_input_file(const char *opt, const char *filename)
     return 0;
 }
 
+static void parse_forced_key_frames(char *kf, OutputStream *ost,
+                                    AVCodecContext *avctx)
+{
+    char *p;
+    int n = 1, i;
+    int64_t t;
+
+    for (p = kf; *p; p++)
+        if (*p == ',')
+            n++;
+    ost->forced_kf_count = n;
+    ost->forced_kf_pts = av_malloc(sizeof(*ost->forced_kf_pts) * n);
+    if (!ost->forced_kf_pts) {
+        av_log(NULL, AV_LOG_FATAL, "Could not allocate forced key frames array.\n");
+        exit_program(1);
+    }
+    for (i = 0; i < n; i++) {
+        p = i ? strchr(p, ',') + 1 : kf;
+        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);
+    }
+}
+
 static OutputStream *new_video_stream(AVFormatContext *oc, int file_idx)
 {
     AVStream *st;



More information about the ffmpeg-cvslog mailing list