Improve AVPlayer performance

Fix updating aspect ratio

Fix #170
This commit is contained in:
Arkadiusz Fal
2022-08-13 16:11:07 +02:00
parent a347474437
commit e609e90165
4 changed files with 35 additions and 16 deletions

View File

@@ -871,4 +871,14 @@ final class PlayerModel: ObservableObject {
mpvBackend.setVideoToAuto()
}
func updateAspectRatio() {
guard aspectRatio != backend.aspectRatio else { return }
DispatchQueue.main.async { [weak self] in
guard let self = self else { return }
self.aspectRatio = self.backend.aspectRatio
}
}
}