[Mplayer-cvslog] CVS: main/libmpdemux tvi_v4l.c,1.48,1.49

Arpi of Ize arpi at mplayerhq.hu
Tue Dec 31 03:21:43 CET 2002


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

Modified Files:
	tvi_v4l.c 
Log Message:
Obvious patch to avoid undefined behaviour of multiple side effects in
a single expression.
patch by Wolfram Gloger <wmglo at dent.med.uni-muenchen.de>


Index: tvi_v4l.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/tvi_v4l.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- tvi_v4l.c	29 Dec 2002 23:10:08 -0000	1.48
+++ tvi_v4l.c	31 Dec 2002 02:21:28 -0000	1.49
@@ -1377,7 +1377,7 @@
     interval = (double)priv->video_timebuffer[priv->video_head]*1e-6;
     memcpy(buffer, priv->video_ringbuffer[priv->video_head], len);
     priv->video_cnt--;
-    priv->video_head = (++priv->video_head)%priv->video_buffer_size_current;
+    priv->video_head = (priv->video_head+1)%priv->video_buffer_size_current;
     pthread_mutex_unlock(&priv->video_buffer_mutex);
     return interval;
 }
@@ -1447,7 +1447,7 @@
 	    mp_msg(MSGT_TV, MSGL_ERR, "\ntoo bad - dropping audio frame !\n");
 	    priv->audio_drop++;
 	} else {
-	    priv->audio_tail = (++priv->audio_tail) % priv->audio_buffer_size;
+	    priv->audio_tail = (priv->audio_tail+1) % priv->audio_buffer_size;
 	    priv->audio_cnt++;
 	}
     }
@@ -1471,7 +1471,7 @@
 	usleep(10000);
     }
     memcpy(buffer, priv->audio_ringbuffer+priv->audio_head*priv->audio_in.blocksize, len);
-    priv->audio_head = (++priv->audio_head) % priv->audio_buffer_size;
+    priv->audio_head = (priv->audio_head+1) % priv->audio_buffer_size;
     priv->audio_cnt--;
     priv->audio_sent_blocks_total++;
     return (double)priv->audio_sent_blocks_total*priv->audio_secs_per_block;




More information about the MPlayer-cvslog mailing list