mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 13:33:42 +00:00
Minor performance improvement
This commit is contained in:
parent
7972498f2c
commit
5d8e8483d1
@ -222,7 +222,9 @@ final class MPVBackend: PlayerBackend {
|
||||
func playStream(_ stream: Stream, of video: Video, preservingTime: Bool, upgrading: Bool) {
|
||||
#if !os(macOS)
|
||||
if model.presentingPlayer {
|
||||
UIApplication.shared.isIdleTimerDisabled = true
|
||||
DispatchQueue.main.async {
|
||||
UIApplication.shared.isIdleTimerDisabled = true
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -459,12 +459,16 @@ final class PlayerModel: ObservableObject {
|
||||
return
|
||||
}
|
||||
|
||||
streamSelection = stream
|
||||
playStream(
|
||||
stream,
|
||||
of: currentVideo,
|
||||
preservingTime: !currentItem.playbackTime.isNil
|
||||
)
|
||||
DispatchQueue.global(qos: .userInitiated).async {
|
||||
DispatchQueue.main.async {
|
||||
self.streamSelection = stream
|
||||
}
|
||||
self.playStream(
|
||||
stream,
|
||||
of: currentVideo,
|
||||
preservingTime: !self.currentItem.playbackTime.isNil
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private func handlePresentationChange() {
|
||||
|
@ -95,6 +95,8 @@ extension PlayerModel {
|
||||
|
||||
func resetSegments() {
|
||||
resetLastSegment()
|
||||
restoredSegments = []
|
||||
DispatchQueue.main.async { [weak self] in
|
||||
self?.restoredSegments = []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user