[vlc-devel] [PATCH 01/17] player: timer: don't use negative length

Thomas Guillem thomas at gllm.fr
Mon Feb 15 10:14:56 UTC 2021


It's more a failsafe since demuxers should not send negative lengths.
---
 src/player/timer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/player/timer.c b/src/player/timer.c
index 5afa4aa5203..48005571494 100644
--- a/src/player/timer.c
+++ b/src/player/timer.c
@@ -279,7 +279,8 @@ vlc_player_UpdateTimer(vlc_player_t *player, vlc_es_id_t *es_source,
             player->timer.last_ts = VLC_TICK_INVALID;
             force_update = true;
         }
-        if (player->timer.input_length != point->length)
+        if (player->timer.input_length != point->length
+         && point->length >= VLC_TICK_0)
         {
             player->timer.input_length = point->length;
             player->timer.last_ts = VLC_TICK_INVALID;
-- 
2.30.0



More information about the vlc-devel mailing list