From 67ae0fcf8de62d90b7074c4f1c8403c9d1702349 Mon Sep 17 00:00:00 2001 From: Roderick van Domburg Date: Thu, 6 Jan 2022 22:11:53 +0100 Subject: [PATCH] Fix gapless playback --- playback/src/player.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/playback/src/player.rs b/playback/src/player.rs index 56c57334..d3fe5aca 100644 --- a/playback/src/player.rs +++ b/playback/src/player.rs @@ -1104,6 +1104,8 @@ impl Future for PlayerInternal { match decoder.next_packet() { Ok(result) => { if let Some((new_stream_position_ms, ref packet)) = result { + *stream_position_ms = new_stream_position_ms; + if !passthrough { match packet.samples() { Ok(_) => { @@ -1144,9 +1146,6 @@ impl Future for PlayerInternal { }) } } - } else { - // position, even if irrelevant, must be set so that seek() is called - *stream_position_ms = new_stream_position_ms; } }