diff options
-rw-r--r-- | cfg-mencoder.h | 4 | ||||
-rw-r--r-- | mencoder.c | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/cfg-mencoder.h b/cfg-mencoder.h index d064545541..e374b2a752 100644 --- a/cfg-mencoder.h +++ b/cfg-mencoder.h @@ -81,6 +81,10 @@ static config_t mencoder_opts[]={ {"ofps", &force_ofps, CONF_TYPE_FLOAT, CONF_MIN, 0, 0, NULL}, {"o", &out_filename, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"skiplimit", &skip_limit, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"noskiplimit", &skip_limit, CONF_TYPE_FLAG, 0, 0, -1, NULL}, + {"noskip", &skip_limit, CONF_TYPE_FLAG, 0, 0, 0, NULL}, + {"x", &vo_w, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL}, {"y", &vo_h, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL}, diff --git a/mencoder.c b/mencoder.c index d0e01a0bd4..a291f94309 100644 --- a/mencoder.c +++ b/mencoder.c @@ -132,6 +132,7 @@ static float c_total=0; float force_fps=0; float force_ofps=0; // set to 24 for inverse telecine +static int skip_limit=-1; int force_srate=0; @@ -862,11 +863,13 @@ if(demuxer2){ // 3-pass encoding, read control file (frameno.avi) // check frame duplicate/drop: -if(v_timer_corr>=(float)mux_v->h.dwScale/mux_v->h.dwRate){ +if(v_timer_corr>=(float)mux_v->h.dwScale/mux_v->h.dwRate && + (skip_limit<0 || skip_flag<skip_limit) ){ v_timer_corr-=(float)mux_v->h.dwScale/mux_v->h.dwRate; ++skip_flag; // skip } else -while(v_timer_corr<=-(float)mux_v->h.dwScale/mux_v->h.dwRate){ +while(v_timer_corr<=-(float)mux_v->h.dwScale/mux_v->h.dwRate && + (skip_limit<0 || (-skip_flag)<skip_limit) ){ v_timer_corr+=(float)mux_v->h.dwScale/mux_v->h.dwRate; --skip_flag; // dup } |