Skip to content

Commit

Permalink
fix incorrect timescale
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMoonThatRises committed Dec 9, 2024
1 parent 666ffca commit 4a2ff4e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Spwifiy/Extensions/Internal/AVAudioPlayer+controls.swift
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ extension AVAudioPlayer {

commandCenter.changePlaybackPositionCommand.addTarget { event in
let seconds = (event as? MPChangePlaybackPositionCommandEvent)?.positionTime ?? 0
let time = CMTime(seconds: seconds, preferredTimescale: 1)
let time = CMTime(seconds: seconds, preferredTimescale: 100)
self.seek(time: time)

return .success
Expand Down
4 changes: 2 additions & 2 deletions Spwifiy/Extensions/Internal/AVAudioPlayer+sponsorBlock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ extension AVAudioPlayer {
seekTime += segment.1 - segment.0
}

return CMTime(seconds: seekTime, preferredTimescale: 1000)
return CMTime(seconds: seekTime, preferredTimescale: 100)
}

func skipSponsorBlockSegment() {
Expand All @@ -67,7 +67,7 @@ extension AVAudioPlayer {
if segment.1 >= (player.currentItem?.duration.seconds ?? 0) {
nextSong()
} else {
seek(time: CMTime(seconds: segment.1, preferredTimescale: 1000))
seek(time: CMTime(seconds: segment.1, preferredTimescale: 100))
}

return
Expand Down
2 changes: 1 addition & 1 deletion Spwifiy/Utils/AVAudioPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class AVAudioPlayer: ObservableObject {
if isScrubbing {
player.pause()
} else {
seek(time: CMTime(seconds: currentPlayTime, preferredTimescale: 1))
seek(time: CMTime(seconds: currentPlayTime, preferredTimescale: 100))
player.play()
}
}
Expand Down

0 comments on commit 4a2ff4e

Please sign in to comment.