[MPlayer-cvslog] CVS: main/libmpdemux tvi_v4l2.c,1.23,1.24

Jindrich Makovicka CVS syncmail at mplayerhq.hu
Sat May 14 15:04:32 CEST 2005


CVS change done by Jindrich Makovicka CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv20216

Modified Files:
	tvi_v4l2.c 
Log Message:
cleanups of the mutex usage

Index: tvi_v4l2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/tvi_v4l2.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- tvi_v4l2.c	14 May 2005 07:52:47 -0000	1.23
+++ tvi_v4l2.c	14 May 2005 13:04:30 -0000	1.24
@@ -844,7 +844,7 @@
     }
 
     /* stop audio thread */
-    if (!tv_param_noaudio && !tv_param_immediate) {
+    if (!tv_param_noaudio) {
 	pthread_join(priv->audio_grabber_thread, NULL);
 	pthread_mutex_destroy(&priv->skew_mutex);
 	pthread_mutex_destroy(&priv->audio_mutex);
@@ -1432,9 +1432,9 @@
 
 	/* store the timestamp of the very first frame as reference */
 	if (!priv->frames++) {
-	    pthread_mutex_lock(&priv->skew_mutex);
+	    if (!tv_param_noaudio) pthread_mutex_lock(&priv->skew_mutex);
 	    priv->first_frame = (long long)1e6*buf.timestamp.tv_sec + buf.timestamp.tv_usec;
-	    pthread_mutex_unlock(&priv->skew_mutex);
+	    if (!tv_param_noaudio) pthread_mutex_unlock(&priv->skew_mutex);
 	}
 	priv->curr_frame = (long long)buf.timestamp.tv_sec*1e6+buf.timestamp.tv_usec;
 //	fprintf(stderr, "idx = %d, ts = %lf\n", buf.index, (double)(priv->curr_frame) / 1e6);
@@ -1444,9 +1444,9 @@
 
 	if (!priv->immediate_mode) {
 	    // interpolate the skew in time
-	    pthread_mutex_lock(&priv->skew_mutex);
+	    if (!tv_param_noaudio) pthread_mutex_lock(&priv->skew_mutex);
 	    xskew = priv->audio_skew + (interval - priv->audio_skew_measure_time)*priv->audio_skew_factor;
-	    pthread_mutex_unlock(&priv->skew_mutex);
+	    if (!tv_param_noaudio) pthread_mutex_unlock(&priv->skew_mutex);
  	    // correct extreme skew changes to avoid (especially) moving backwards in time
 	    if (xskew - prev_skew > delta*MAX_SKEW_DELTA) {
 		skew = prev_skew + delta*MAX_SKEW_DELTA;




More information about the MPlayer-cvslog mailing list