[vlc-commits] player: timer: don't use negative length

Thomas Guillem git at videolan.org
Fri Mar 5 14:55:17 UTC 2021


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Feb  3 14:13:11 2021 +0100| [ca4a2fd48af47ad263e5b0f401fe850b3bea4e38] | committer: Thomas Guillem

player: timer: don't use negative length

It's more a failsafe since demuxers should not send negative lengths.

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

 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 5afa4aa520..4800557149 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;



More information about the vlc-commits mailing list