[FFmpeg-cvslog] avconv: move limit_filesize to options context

Anton Khirnov git at videolan.org
Mon Sep 5 03:17:44 CEST 2011


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sun Aug 28 18:20:17 2011 +0200| [13ccba50d45662a15777b549b2fcd9b4621b0e01] | committer: Anton Khirnov

avconv: move limit_filesize to options context

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

 avconv.c           |    8 ++++----
 tests/fate/mp3.mak |   12 ++++++------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/avconv.c b/avconv.c
index 1e354ff..a3ab7b9 100644
--- a/avconv.c
+++ b/avconv.c
@@ -190,7 +190,6 @@ static int64_t extra_size = 0;
 static int nb_frames_dup = 0;
 static int nb_frames_drop = 0;
 static int input_sync;
-static uint64_t limit_filesize = UINT64_MAX;
 static int force_fps = 0;
 static char *forced_key_frames = NULL;
 
@@ -323,6 +322,7 @@ typedef struct OptionsContext {
     int     nb_stream_maps;
 
     int64_t recording_time;
+    uint64_t limit_filesize;
 } OptionsContext;
 
 static void reset_options(OptionsContext *o)
@@ -353,6 +353,7 @@ static void reset_options(OptionsContext *o)
     memset(o, 0, sizeof(*o));
 
     o->recording_time = INT64_MAX;
+    o->limit_filesize = UINT64_MAX;
 
     uninit_opts();
     init_opts();
@@ -3552,7 +3553,7 @@ static void opt_output_file(void *optctx, const char *filename)
     output_files[nb_output_files - 1].ost_index = nb_output_streams - oc->nb_streams;
     output_files[nb_output_files - 1].recording_time = o->recording_time;
     output_files[nb_output_files - 1].start_time     = o->start_time;
-    output_files[nb_output_files - 1].limit_filesize = limit_filesize;
+    output_files[nb_output_files - 1].limit_filesize = o->limit_filesize;
     av_dict_copy(&output_files[nb_output_files - 1].opts, format_opts, 0);
 
     /* check filename in case of an image number is expected */
@@ -3678,7 +3679,6 @@ static void opt_output_file(void *optctx, const char *filename)
     audio_channels    = 0;
     audio_sample_fmt  = AV_SAMPLE_FMT_NONE;
     chapters_input_file = INT_MAX;
-    limit_filesize = UINT64_MAX;
 
     av_freep(&meta_data_maps);
     nb_meta_data_maps = 0;
@@ -4041,7 +4041,7 @@ static const OptionDef options[] = {
       "outfile[,metadata]:infile[,metadata]" },
     { "map_chapters",  OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&chapters_input_file},  "set chapters mapping", "input_file_index" },
     { "t", HAS_ARG | OPT_TIME | OPT_OFFSET, {.off = OFFSET(recording_time)}, "record or transcode \"duration\" seconds of audio/video", "duration" },
-    { "fs", HAS_ARG | OPT_INT64, {(void*)&limit_filesize}, "set the limit file size in bytes", "limit_size" }, //
+    { "fs", HAS_ARG | OPT_INT64 | OPT_OFFSET, {.off = OFFSET(limit_filesize)}, "set the limit file size in bytes", "limit_size" }, //
     { "ss", HAS_ARG | OPT_TIME | OPT_OFFSET, {.off = OFFSET(start_time)}, "set the start time offset", "time_off" },
     { "itsoffset", HAS_ARG | OPT_TIME | OPT_OFFSET, {.off = OFFSET(input_ts_offset)}, "set the input ts offset", "time_off" },
     { "itsscale", HAS_ARG, {(void*)opt_input_ts_scale}, "set the input ts scale", "scale" },
diff --git a/tests/fate/mp3.mak b/tests/fate/mp3.mak
index 859a4f3..9dfa829 100644
--- a/tests/fate/mp3.mak
+++ b/tests/fate/mp3.mak
@@ -4,32 +4,32 @@ fate-mp3-float-conf-compl: CMP = stddev
 fate-mp3-float-conf-compl: REF = $(SAMPLES)/mp3-conformance/compl.pcm
 
 FATE_MP3 += fate-mp3-float-conf-he_32khz
-fate-mp3-float-conf-he_32khz: CMD = pcm -acodec mp3float  -fs 343296 -i $(SAMPLES)/mp3-conformance/he_32khz.bit
+fate-mp3-float-conf-he_32khz: CMD = pcm -acodec mp3float -i $(SAMPLES)/mp3-conformance/he_32khz.bit -fs 343296
 fate-mp3-float-conf-he_32khz: CMP = stddev
 fate-mp3-float-conf-he_32khz: REF = $(SAMPLES)/mp3-conformance/he_32khz.pcm
 
 FATE_MP3 += fate-mp3-float-conf-he_44khz
-fate-mp3-float-conf-he_44khz: CMD = pcm -acodec mp3float -fs 942336 -i $(SAMPLES)/mp3-conformance/he_44khz.bit
+fate-mp3-float-conf-he_44khz: CMD = pcm -acodec mp3float -i $(SAMPLES)/mp3-conformance/he_44khz.bit -fs 942336
 fate-mp3-float-conf-he_44khz: CMP = stddev
 fate-mp3-float-conf-he_44khz: REF = $(SAMPLES)/mp3-conformance/he_44khz.pcm
 
 FATE_MP3 += fate-mp3-float-conf-he_48khz
-fate-mp3-float-conf-he_48khz: CMD = pcm -acodec mp3float -fs 343296 -i $(SAMPLES)/mp3-conformance/he_48khz.bit
+fate-mp3-float-conf-he_48khz: CMD = pcm -acodec mp3float -i $(SAMPLES)/mp3-conformance/he_48khz.bit -fs 343296
 fate-mp3-float-conf-he_48khz: CMP = stddev
 fate-mp3-float-conf-he_48khz: REF = $(SAMPLES)/mp3-conformance/he_48khz.pcm
 
 FATE_MP3 += fate-mp3-float-conf-hecommon
-fate-mp3-float-conf-hecommon: CMD = pcm -acodec mp3float -fs 133632 -i $(SAMPLES)/mp3-conformance/hecommon.bit
+fate-mp3-float-conf-hecommon: CMD = pcm -acodec mp3float -i $(SAMPLES)/mp3-conformance/hecommon.bit -fs 133632
 fate-mp3-float-conf-hecommon: CMP = stddev
 fate-mp3-float-conf-hecommon: REF = $(SAMPLES)/mp3-conformance/hecommon.pcm
 
 FATE_MP3 += fate-mp3-float-conf-si
-fate-mp3-float-conf-si: CMD = pcm -acodec mp3float -fs 269568 -i $(SAMPLES)/mp3-conformance/si.bit
+fate-mp3-float-conf-si: CMD = pcm -acodec mp3float -i $(SAMPLES)/mp3-conformance/si.bit -fs 269568
 fate-mp3-float-conf-si: CMP = stddev
 fate-mp3-float-conf-si: REF = $(SAMPLES)/mp3-conformance/si.pcm
 
 FATE_MP3 += fate-mp3-float-conf-si_block
-fate-mp3-float-conf-si_block: CMD = pcm -acodec mp3float -fs 145152 -i $(SAMPLES)/mp3-conformance/si_block.bit
+fate-mp3-float-conf-si_block: CMD = pcm -acodec mp3float -i $(SAMPLES)/mp3-conformance/si_block.bit -fs 145152
 fate-mp3-float-conf-si_block: CMP = stddev
 fate-mp3-float-conf-si_block: REF = $(SAMPLES)/mp3-conformance/si_block.pcm
 



More information about the ffmpeg-cvslog mailing list