Commit b6e16b86 authored by Calcium's avatar Calcium Committed by Michael Niedermayer

08_limit_in_filesize.patch by (Calcium | calcium nurs or jp)

Originally committed as revision 4061 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent ff8cc24b
...@@ -266,6 +266,7 @@ static int64_t extra_size = 0; ...@@ -266,6 +266,7 @@ static int64_t extra_size = 0;
static int nb_frames_dup = 0; static int nb_frames_dup = 0;
static int nb_frames_drop = 0; static int nb_frames_drop = 0;
static int input_sync; static int input_sync;
static int limit_filesize = 0; //
static int pgmyuv_compatibility_hack=0; static int pgmyuv_compatibility_hack=0;
...@@ -1882,6 +1883,10 @@ static int av_encode(AVFormatContext **output_files, ...@@ -1882,6 +1883,10 @@ static int av_encode(AVFormatContext **output_files,
if (recording_time > 0 && opts_min >= (recording_time / 1000000.0)) if (recording_time > 0 && opts_min >= (recording_time / 1000000.0))
break; 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 */ /* read a frame from it and output it in the fifo */
is = input_files[file_index]; is = input_files[file_index];
if (av_read_frame(is, &pkt) < 0) { if (av_read_frame(is, &pkt) < 0) {
...@@ -3905,6 +3910,7 @@ const OptionDef options[] = { ...@@ -3905,6 +3910,7 @@ const OptionDef options[] = {
{ "map", HAS_ARG | OPT_EXPERT, {(void*)opt_map}, "set input stream mapping", "file:stream" }, { "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" }, { "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" }, { "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" }, { "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" }, { "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" }, { "title", HAS_ARG | OPT_STRING, {(void*)&str_title}, "set the title", "string" },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment