Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
Reducing the number of dispatching blocks
Browse files Browse the repository at this point in the history
May relate to #17
  • Loading branch information
CarterLi committed Apr 28, 2022
1 parent 5e6ba07 commit df14059
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 0 additions & 7 deletions iina/MPVController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ class MPVController: NSObject {
MPVProperty.mediaTitle: MPV_FORMAT_STRING,
MPVProperty.videoParamsRotate: MPV_FORMAT_INT64,
MPVProperty.idleActive: MPV_FORMAT_FLAG,
MPVProperty.timePos: MPV_FORMAT_INT64
]

private let isDestroyed = DispatchSemaphore(value: 0)
Expand Down Expand Up @@ -1063,12 +1062,6 @@ class MPVController: NSObject {
receivedEndFileWhileLoading = false
}

case MPVProperty.timePos:
DispatchQueue.main.async {
guard self.player.mainWindow.isWindowLoaded else { return }
self.player.mainWindow.updateDanmakuTime()
}

default:
// Utility.log("MPV property changed (unhandled): \(name)")
break
Expand Down
1 change: 1 addition & 0 deletions iina/PlayerCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1413,6 +1413,7 @@ class PlayerCore: NSObject {
self.mainWindow.updatePlayTime(withDuration: true, andProgressBar: true)
}
self.mainWindow.updateNetworkState()
self.mainWindow.updateDanmakuTime()
}

case .playButton:
Expand Down

0 comments on commit df14059

Please sign in to comment.