diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-12-31 02:21:28 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-12-31 02:21:28 +0000 |
commit | c9c0ec893d25eee80f4ab912e1693c071b80f65a (patch) | |
tree | 353b64b45cd20c550972a4f908a1c496612c44cf | |
parent | 2035c458a3964f08ced3be8cc166bca325068224 (diff) | |
download | mpv-c9c0ec893d25eee80f4ab912e1693c071b80f65a.tar.bz2 mpv-c9c0ec893d25eee80f4ab912e1693c071b80f65a.tar.xz |
Obvious patch to avoid undefined behaviour of multiple side effects in
a single expression.
patch by Wolfram Gloger <wmglo@dent.med.uni-muenchen.de>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8672 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libmpdemux/tvi_v4l.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libmpdemux/tvi_v4l.c b/libmpdemux/tvi_v4l.c index ac2cac401d..8d27a70043 100644 --- a/libmpdemux/tvi_v4l.c +++ b/libmpdemux/tvi_v4l.c @@ -1377,7 +1377,7 @@ static double grab_video_frame(priv_t *priv, char *buffer, int len) 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 @@ static void *audio_grabber(void *data) 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 @@ static double grab_audio_frame(priv_t *priv, char *buffer, int len) 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; |