[vlc-commits] audioscrobbler: init the amount of time to wait to VLC_TICK_INVALID

Steve Lhomme git at videolan.org
Wed Sep 19 15:46:31 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jun 12 12:10:07 2018 +0200| [6b86c95bcf3317ce229db8ffb0c72578311d03e9] | committer: Steve Lhomme

audioscrobbler: init the amount of time to wait to VLC_TICK_INVALID

So we don't use it when not set

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

 modules/misc/audioscrobbler.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/misc/audioscrobbler.c b/modules/misc/audioscrobbler.c
index 085c73d84f..f6194492c9 100644
--- a/modules/misc/audioscrobbler.c
+++ b/modules/misc/audioscrobbler.c
@@ -674,7 +674,7 @@ static void *Run(void *data)
     bool                    b_nowp_submission_ongoing = false;
 
     /* data about audioscrobbler session */
-    vlc_tick_t              next_exchange = 0; /**< when can we send data  */
+    vlc_tick_t              next_exchange = VLC_TICK_INVALID; /**< when can we send data  */
     unsigned int            i_interval = 0;     /**< waiting interval (secs)*/
 
     intf_sys_t *p_sys = p_intf->p_sys;
@@ -683,7 +683,8 @@ static void *Run(void *data)
     for (;;)
     {
         vlc_restorecancel(canc);
-        vlc_tick_wait(next_exchange);
+        if (next_exchange != VLC_TICK_INVALID)
+            vlc_tick_wait(next_exchange);
 
         vlc_mutex_lock(&p_sys->lock);
         mutex_cleanup_push(&p_sys->lock);
@@ -718,7 +719,7 @@ static void *Run(void *data)
                     msg_Dbg(p_intf, "Handshake successful :)");
                     b_handshaked = true;
                     i_interval = 0;
-                    next_exchange = 0;
+                    next_exchange = VLC_TICK_INVALID;
                     break;
 
                 case VLC_AUDIOSCROBBLER_EFATAL:
@@ -901,7 +902,7 @@ static void *Run(void *data)
             }
 
             i_interval = 0;
-            next_exchange = 0;
+            next_exchange = VLC_TICK_INVALID;
             msg_Dbg(p_intf, "Submission successful!");
         }
         else



More information about the vlc-commits mailing list