changeset 5629:9b422f216fb5

-skiplimit/-noskip options to disable fps correction
author arpi
date Mon, 15 Apr 2002 02:33:05 +0000
parents e1179cdffbf5
children dfc219577da6
files cfg-mencoder.h mencoder.c
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/cfg-mencoder.h	Mon Apr 15 01:58:18 2002 +0000
+++ b/cfg-mencoder.h	Mon Apr 15 02:33:05 2002 +0000
@@ -81,6 +81,10 @@
 	{"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},
 
--- a/mencoder.c	Mon Apr 15 01:58:18 2002 +0000
+++ b/mencoder.c	Mon Apr 15 02:33:05 2002 +0000
@@ -132,6 +132,7 @@
 
 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 @@
 
 // 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
 }