[FFmpeg-cvslog] ffmpeg_opt: fix recording time in->out carryover.

Michael Niedermayer git at videolan.org
Thu Dec 20 17:47:25 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Dec 20 17:37:08 2012 +0100| [103410d67ec9035b9fc04a0685d6d921bdb7524e] | committer: Michael Niedermayer

ffmpeg_opt: fix recording time in->out carryover.

This should fix valgrind complaints.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 ffmpeg_opt.c |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index a57c885..fcd6048 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -95,6 +95,8 @@ static int intra_dc_precision = 8;
 static int do_psnr            = 0;
 static int input_sync;
 
+static int64_t recording_time = INT64_MAX;
+
 static void uninit_options(OptionsContext *o, int is_input)
 {
     const OptionDef *po = options;
@@ -125,21 +127,21 @@ static void uninit_options(OptionsContext *o, int is_input)
     av_freep(&o->audio_channel_maps);
     av_freep(&o->streamid_map);
 
-    if (!is_input)
-        o->recording_time = INT64_MAX;
+    if (is_input)
+        recording_time = o->recording_time;
+    else
+        recording_time = INT64_MAX;
 }
 
 static void init_options(OptionsContext *o, int is_input)
 {
-    OptionsContext bak= *o;
     memset(o, 0, sizeof(*o));
 
-    if (!is_input) {
-        o->recording_time = bak.recording_time;
-        if (o->recording_time != INT64_MAX)
-            av_log(NULL, AV_LOG_WARNING,
-                   "-t is not an input option, keeping it for the next output;"
-                   " consider fixing your command line.\n");
+    if (!is_input && recording_time != INT64_MAX) {
+        o->recording_time = recording_time;
+        av_log(NULL, AV_LOG_WARNING,
+                "-t is not an input option, keeping it for the next output;"
+                " consider fixing your command line.\n");
     } else
     o->recording_time = INT64_MAX;
     o->mux_max_delay  = 0.7;



More information about the ffmpeg-cvslog mailing list