Skip to content

Commit

Permalink
Merge pull request #855 from glouel/master
Browse files Browse the repository at this point in the history
Fix for multi monitor hang/crash on 2nd video
  • Loading branch information
glouel authored Oct 1, 2019
2 parents 820dbd0 + de95c62 commit 9112eed
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Aerial.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1185,15 +1185,15 @@
CODE_SIGN_IDENTITY = "Developer ID Application: Guillaume Louel (3L54M5L5KK)";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1.6.0;
CURRENT_PROJECT_VERSION = 1.6.0test1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 3L54M5L5KK;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "$(SRCROOT)/Resources/Info.plist";
INSTALL_PATH = "$(HOME)/Library/Screen Savers";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 1.6.0;
MARKETING_VERSION = 1.6.0test1;
PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -1214,15 +1214,15 @@
CODE_SIGN_IDENTITY = "Developer ID Application: Guillaume Louel (3L54M5L5KK)";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1.6.0;
CURRENT_PROJECT_VERSION = 1.6.0test1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 3L54M5L5KK;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "$(SRCROOT)/Resources/Info.plist";
INSTALL_PATH = "$(HOME)/Library/Screen Savers";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 1.6.0;
MARKETING_VERSION = 1.6.0test1;
OTHER_CODE_SIGN_FLAGS = "--timestamp";
PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
4 changes: 2 additions & 2 deletions Aerial/Source/Models/Cache/VideoCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ final class VideoCache {
}
}

if !userCachePaths.isEmpty {
if !userCachePaths.isEmpty && cacheDirectory == nil {
let userCacheDirectory = userCachePaths[0] as NSString

if cacheDirectory == nil && aerialFolderExists(at: userCacheDirectory) {
if aerialFolderExists(at: userCacheDirectory) {
debugLog("Using existing user cache ~/Library/Caches/Aerial")
cacheDirectory = userCacheDirectory.appendingPathComponent("Aerial")
} else {
Expand Down
7 changes: 4 additions & 3 deletions Aerial/Source/Views/AerialView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -523,11 +523,12 @@ final class AerialView: ScreenSaverView, CAAnimationDelegate {
context: UnsafeMutableRawPointer?) {
debugLog("\(self.description) observeValue \(String(describing: keyPath))")

if keyPath == "rate" {
/*if keyPath == "rate" {
if self.player!.rate > 0 {
debugLog("video started playing")
}
} else if self.playerLayer.isReadyForDisplay {
} else */
if self.playerLayer.isReadyForDisplay {
self.player!.play()
hasStartedPlaying = true

Expand Down Expand Up @@ -568,7 +569,7 @@ final class AerialView: ScreenSaverView, CAAnimationDelegate {
let oldPlayer = self.player
self.player = player
player.isMuted = true
player.addObserver(self, forKeyPath: "rate", options: NSKeyValueObservingOptions.new, context: nil)
// player.addObserver(self, forKeyPath: "rate", options: NSKeyValueObservingOptions.new, context: nil)

self.playerLayer.player = self.player
if AerialView.shouldFade {
Expand Down

0 comments on commit 9112eed

Please sign in to comment.