diff --git a/youtui/src/app/server/player/rodio_thread.rs b/youtui/src/app/server/player/rodio_thread.rs index da2b481d..cccbd449 100644 --- a/youtui/src/app/server/player/rodio_thread.rs +++ b/youtui/src/app/server/player/rodio_thread.rs @@ -6,6 +6,7 @@ use crate::core::oneshot_send_or_error; use crate::core::send_or_error; use rodio::decoder::DecoderError; use rodio::source::PeriodicAccess; +use rodio::source::SkipDuration; use rodio::source::TrackPosition; use rodio::Decoder; use rodio::Source; @@ -330,9 +331,11 @@ fn try_decode( song_id: ListSongID, tx: mpsc::Sender, ) -> std::result::Result< - PeriodicAccess< - TrackPosition>>, - impl FnMut(&mut TrackPosition>>), + SkipDuration< + PeriodicAccess< + TrackPosition>>, + impl FnMut(&mut TrackPosition>>), + >, >, DecoderError, > { @@ -348,5 +351,6 @@ fn try_decode( .periodic_access(PROGRESS_UPDATE_DELAY, move |s| { blocking_send_or_error(&tx, PlaySongResponse::ProgressUpdate(s.get_pos())); }) + .skip_duration(Duration::from_millis(120)) }) }