diff options
author | Calcium <calcium@nurs.or.jp> | 2005-03-22 18:20:07 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-03-22 18:20:07 +0000 |
commit | b6e16b8653ca2fcc9c6f60491101651fa4754a37 (patch) | |
tree | dc86c9eb9ff170f6eede97ce4974775f4785a3cd /ffmpeg.c | |
parent | ff8cc24bf54cd2163eb31efa25ff79ba62306784 (diff) | |
download | ffmpeg-b6e16b8653ca2fcc9c6f60491101651fa4754a37.tar.gz |
08_limit_in_filesize.patch by (Calcium | calcium nurs or jp)
Originally committed as revision 4061 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -266,6 +266,7 @@ static int64_t extra_size = 0; static int nb_frames_dup = 0; static int nb_frames_drop = 0; static int input_sync; +static int limit_filesize = 0; // static int pgmyuv_compatibility_hack=0; @@ -1882,6 +1883,10 @@ static int av_encode(AVFormatContext **output_files, if (recording_time > 0 && opts_min >= (recording_time / 1000000.0)) break; + /* finish if limit size exhausted */ + if (limit_filesize != 0 && (limit_filesize * 1024) < url_ftell(&output_files[0]->pb)) + break; + /* read a frame from it and output it in the fifo */ is = input_files[file_index]; if (av_read_frame(is, &pkt) < 0) { @@ -3905,6 +3910,7 @@ const OptionDef options[] = { { "map", HAS_ARG | OPT_EXPERT, {(void*)opt_map}, "set input stream mapping", "file:stream" }, { "map_meta_data", HAS_ARG | OPT_EXPERT, {(void*)opt_map_meta_data}, "set meta data information of outfile from infile", "outfile:infile" }, { "t", HAS_ARG, {(void*)opt_recording_time}, "set the recording time", "duration" }, + { "fs", HAS_ARG | OPT_INT, {(void*)&limit_filesize}, "set the limit file size", "limit_size" }, // { "ss", HAS_ARG, {(void*)opt_start_time}, "set the start time offset", "time_off" }, { "itsoffset", HAS_ARG, {(void*)opt_input_ts_offset}, "set the input ts offset", "time_off" }, { "title", HAS_ARG | OPT_STRING, {(void*)&str_title}, "set the title", "string" }, |