Skip to content

Commit

Permalink
Add short skip duration to improve gapless
Browse files Browse the repository at this point in the history
  • Loading branch information
nick42d committed Aug 27, 2024
1 parent c22254c commit b8fab76
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions youtui/src/app/server/player/rodio_thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -330,9 +331,11 @@ fn try_decode(
song_id: ListSongID,
tx: mpsc::Sender<PlaySongResponse>,
) -> std::result::Result<
PeriodicAccess<
TrackPosition<Decoder<Cursor<DroppableSong>>>,
impl FnMut(&mut TrackPosition<Decoder<Cursor<DroppableSong>>>),
SkipDuration<
PeriodicAccess<
TrackPosition<Decoder<Cursor<DroppableSong>>>,
impl FnMut(&mut TrackPosition<Decoder<Cursor<DroppableSong>>>),
>,
>,
DecoderError,
> {
Expand All @@ -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))
})
}

0 comments on commit b8fab76

Please sign in to comment.