Skip to content

Commit 27b3c6a

Browse files
authored
Merge pull request #60 from yoheimuta/fix-race-conditions-around-player
Prevent a crash if user press next too fast and many times
2 parents 7c70395 + 370c380 commit 27b3c6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

RxMusicPlayer/RxMusicPlayer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ open class RxMusicPlayer: NSObject {
200200
let desiredPlaybackRateRelay = BehaviorRelay<Float>(value: 1.0)
201201
let remoteControlRelay = BehaviorRelay<RemoteControl>(value: .moveTrack)
202202

203-
private let scheduler = ConcurrentDispatchQueueScheduler(
204-
queue: DispatchQueue.global(qos: .background)
203+
private let scheduler = SerialDispatchQueueScheduler(
204+
queue: DispatchQueue.global(qos: .background), internalSerialQueueName: "RxMusicPlayerSerialQueue"
205205
)
206206
public private(set) var player: AVPlayer? {
207207
set {

0 commit comments

Comments
 (0)