[Mplayer-cvslog] CVS: main/libmpdemux tvi_v4l.c,1.45,1.46

Jindrich Makovicka CVS henry at mplayerhq.hu
Tue Dec 17 00:24:18 CET 2002


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv9117

Modified Files:
	tvi_v4l.c 
Log Message:
don't give up when set_tuner fails; more zero div sanity checks

Index: tvi_v4l.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/tvi_v4l.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- tvi_v4l.c	16 Dec 2002 17:05:49 -0000	1.45
+++ tvi_v4l.c	16 Dec 2002 23:24:02 -0000	1.46
@@ -988,6 +988,8 @@
 	    }
 
 	    if (priv->channels[priv->act_channel].flags & VIDEO_VC_TUNER) {
+		int prev_mode;
+		
 		control(priv, TVI_CONTROL_TUN_GET_TUNER, 0);
 		if (((req_mode == TV_NORM_PAL
 		      || req_mode == TV_NORM_PALNC
@@ -1001,6 +1003,8 @@
 		    return(TVI_CONTROL_FALSE);
 		}
 
+		prev_mode = priv->tuner.mode;
+
 		switch(req_mode) {
 		case TV_NORM_PAL:
 		case TV_NORM_PALNC:
@@ -1018,7 +1022,8 @@
 		}
 	    
 		if (control(priv, TVI_CONTROL_TUN_SET_TUNER, &priv->tuner) != TVI_CONTROL_TRUE) {
-		    return(TVI_CONTROL_FALSE);
+		    // norm setting failed, but maybe it's only because it's fixed
+		    if (priv->tuner.mode != prev_mode) return(TVI_CONTROL_FALSE); // no it really failed
 		}
 
 	    }
@@ -1282,11 +1287,14 @@
 		    interval = (double)framecount/priv->fps;
 		}
 
-		if (!priv->immediate_mode && (
-			(interval - prev_interval < (long long)0.85e6/priv->fps)
-			|| (interval - prev_interval > (long long)1.15e6/priv->fps) ) ) {
-		    mp_msg(MSGT_TV, MSGL_V, "\nvideo capture thread: frame delta ~ %.1lf fps\n",
-			   (double)1e6/(interval - prev_interval));
+		if (!priv->immediate_mode) {
+		    if (interval - prev_interval == 0) {
+			mp_msg(MSGT_TV, MSGL_V, "\nvideo capture thread: frame delta = 0\n");
+		    } else if ((interval - prev_interval < (long long)0.85e6/priv->fps)
+			       || (interval - prev_interval > (long long)1.15e6/priv->fps) ) {
+			mp_msg(MSGT_TV, MSGL_V, "\nvideo capture thread: frame delta ~ %.1lf fps\n",
+			       (double)1e6/(interval - prev_interval));
+		    }
 		}
 
 		// interpolate the skew in time
@@ -1304,7 +1312,8 @@
 	    }
 
 	    mp_msg(MSGT_TV, MSGL_DBG3, "\nfps = %lf, interval = %lf, a_skew = %f, corr_skew = %f\n",
-		   (double)1e6/(interval - prev_interval), (double)1e-6*interval, (double)1e-6*xskew, (double)1e-6*skew);
+		   (interval != prev_interval) ? (double)1e6/(interval - prev_interval) : -1,
+		   (double)1e-6*interval, (double)1e-6*xskew, (double)1e-6*skew);
 	    mp_msg(MSGT_TV, MSGL_DBG3, "vcnt = %d, acnt = %d\n", priv->video_cnt, priv->audio_cnt);
 
 	    prev_skew = skew;




More information about the MPlayer-cvslog mailing list