[Mplayer-cvslog] CVS: main/libmpdemux tvi_v4l.c,1.43,1.44

Jindrich Makovicka CVS henry at mplayerhq.hu
Sat Dec 14 10:56:04 CET 2002


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

Modified Files:
	tvi_v4l.c 
Log Message:
fixed possible division by zero

Index: tvi_v4l.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/tvi_v4l.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- tvi_v4l.c	10 Dec 2002 09:11:42 -0000	1.43
+++ tvi_v4l.c	14 Dec 2002 09:55:45 -0000	1.44
@@ -1404,7 +1404,12 @@
 	// stress testing by dropping half of the audio frames ;)
 	// especially when using ALSA with large block sizes
 	// where audio_skew remains a long while behind
-	priv->audio_skew_factor = (double)(priv->audio_skew-prev_skew)/(current_time - priv->audio_skew_measure_time);
+	if ((priv->audio_skew_measure_time != 0) && (current_time - priv->audio_skew_measure_time != 0)) {
+	    priv->audio_skew_factor = (double)(priv->audio_skew-prev_skew)/(current_time - priv->audio_skew_measure_time);
+	} else {
+	    priv->audio_skew_factor = 0.0;
+	}
+	
 	priv->audio_skew_measure_time = current_time;
 	prev_skew = priv->audio_skew;
 	pthread_mutex_unlock(&priv->skew_mutex);




More information about the MPlayer-cvslog mailing list