vlc | branch: master | Rémi Denis-Courmont <[email protected]> | 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)

_______________________________________________
vlc-commits mailing list
[email protected]
http://mailman.videolan.org/listinfo/vlc-commits

Reply via email to