mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-25 21:04:02 +02:00
Fix race conditions on first launch
This commit is contained in:
@@ -261,6 +261,12 @@ class AudioPlayer: NSObject {
|
||||
}
|
||||
|
||||
public func setPlaybackRate(_ rate: Float, observed: Bool = false) {
|
||||
// Handle a race condition on first launch
|
||||
guard self.status != -1 else {
|
||||
NSLog("Did not set playback rate as player is not initialized")
|
||||
return
|
||||
}
|
||||
|
||||
if self.audioPlayer.rate != rate {
|
||||
NSLog("setPlaybakRate rate changed from \(self.audioPlayer.rate) to \(rate)")
|
||||
self.audioPlayer.rate = rate
|
||||
|
||||
Reference in New Issue
Block a user