Mercurial > mplayer.hg
changeset 8671:e1337452fe62
Obvious patch to avoid undefined behaviour of multiple side effects in
a single expression.
patch by Wolfram Gloger <wmglo@dent.med.uni-muenchen.de>
author | arpi |
---|---|
date | Tue, 31 Dec 2002 02:21:28 +0000 |
parents | c5a28d4445cd |
children | 9065fd98fad3 |
files | libmpdemux/tvi_v4l.c |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/tvi_v4l.c Tue Dec 31 01:19:39 2002 +0000 +++ b/libmpdemux/tvi_v4l.c Tue Dec 31 02:21:28 2002 +0000 @@ -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;