[vlc-devel] [PATCH] clock: don't return an error in vlc_clock_Wait()

Steve Lhomme robux4 at ycbcr.xyz
Thu Aug 13 14:09:23 CEST 2020


Callers never use it and probably won't do much about it.
---
 src/clock/clock.c | 8 ++------
 src/clock/clock.h | 2 +-
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/clock/clock.c b/src/clock/clock.c
index e6c126d1c00..f5c0583e84b 100644
--- a/src/clock/clock.c
+++ b/src/clock/clock.c
@@ -336,7 +336,7 @@ static vlc_tick_t vlc_clock_slave_set_delay(vlc_clock_t *clock, vlc_tick_t delay
     return 0;
 }
 
-int vlc_clock_Wait(vlc_clock_t *clock, vlc_tick_t system_now, vlc_tick_t ts,
+void vlc_clock_Wait(vlc_clock_t *clock, vlc_tick_t system_now, vlc_tick_t ts,
                    double rate, vlc_tick_t max_duration)
 {
     vlc_clock_main_t *main_clock = clock->owner;
@@ -353,13 +353,9 @@ int vlc_clock_Wait(vlc_clock_t *clock, vlc_tick_t system_now, vlc_tick_t ts,
         deadline = __MIN(deadline, max_deadline);
 
         if (vlc_cond_timedwait(&main_clock->cond, &main_clock->lock, deadline))
-        {
-            vlc_mutex_unlock(&main_clock->lock);
-            return 0;
-        }
+            break;
     }
     vlc_mutex_unlock(&main_clock->lock);
-    return -1;
 }
 
 vlc_clock_main_t *vlc_clock_main_New(void)
diff --git a/src/clock/clock.h b/src/clock/clock.h
index 87faab165e8..948aa59d671 100644
--- a/src/clock/clock.h
+++ b/src/clock/clock.h
@@ -167,7 +167,7 @@ vlc_tick_t vlc_clock_SetDelay(vlc_clock_t *clock, vlc_tick_t ts_delay);
 /**
  * Wait for a timestamp expressed in stream time
  */
-int vlc_clock_Wait(vlc_clock_t *clock, vlc_tick_t system_now, vlc_tick_t ts,
+void vlc_clock_Wait(vlc_clock_t *clock, vlc_tick_t system_now, vlc_tick_t ts,
                    double rate, vlc_tick_t max_duration);
 
 /**
-- 
2.26.2



More information about the vlc-devel mailing list