[vlc-commits] commit: Fix one shot timers (=?UTF-8?Q?R=C3=A9mi=20Denis=2DCourmont=20?=)

git at videolan.org git at videolan.org
Wed Nov 24 18:36:15 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Nov 24 19:35:46 2010 +0200| [020fbe57db87914f59420790d2545d385664169a] | committer: Rémi Denis-Courmont 

Fix one shot timers

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=020fbe57db87914f59420790d2545d385664169a
---

 src/misc/pthread.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/misc/pthread.c b/src/misc/pthread.c
index 88691c6..f44157b 100644
--- a/src/misc/pthread.c
+++ b/src/misc/pthread.c
@@ -833,6 +833,12 @@ static void *vlc_timer_thread (void *data)
         unsigned misses;
 
         vlc_mutex_lock (&timer->lock);
+        if (timer->interval == 0)
+        {
+            timer->value = 0; /* disarm */
+            continue;
+        }
+
         misses = (now - timer->value) / timer->interval;
         timer->value += timer->interval;
         /* Try to compensate for one miss (mwait() will return immediately)



More information about the vlc-commits mailing list