[vlc-commits] macosx/continuity controller: fix deadlock
Felix Paul Kühne
git at videolan.org
Sat Apr 13 17:43:14 CEST 2019
vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Sat Apr 13 17:35:25 2019 +0200| [0c75297a137e19afb698251f2c99fc81c48b3a6e] | committer: Felix Paul Kühne
macosx/continuity controller: fix deadlock
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0c75297a137e19afb698251f2c99fc81c48b3a6e
---
.../gui/macosx/playlist/VLCPlaybackContinuityController.m | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/modules/gui/macosx/playlist/VLCPlaybackContinuityController.m b/modules/gui/macosx/playlist/VLCPlaybackContinuityController.m
index d4d319732c..91839f66c8 100644
--- a/modules/gui/macosx/playlist/VLCPlaybackContinuityController.m
+++ b/modules/gui/macosx/playlist/VLCPlaybackContinuityController.m
@@ -32,7 +32,6 @@
@interface VLCPlaybackContinuityController()
{
- __weak VLCMain *_mainInstance;
input_item_t *p_current_input;
}
@end
@@ -53,7 +52,6 @@
{
self = [super init];
if (self) {
- _mainInstance = [VLCMain sharedInstance];
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
[notificationCenter addObserver:self
selector:@selector(inputItemChanged:)
@@ -75,17 +73,18 @@
if (p_current_input) {
/* continue playback where you left off */
- [self storePlaybackPositionForItem:p_current_input player:_mainInstance.playlistController.playerController];
+ [self storePlaybackPositionForItem:p_current_input player:[VLCMain sharedInstance].playlistController.playerController];
}
}
- (void)inputItemChanged:(NSNotification *)aNotification
{
+ VLCMain *mainInstance = [VLCMain sharedInstance];
// Cancel pending resume dialogs
- [[_mainInstance resumeDialog] cancel];
+ [[mainInstance resumeDialog] cancel];
// object is hold here and released then it is dead
- p_current_input = [[_mainInstance playlistController] currentlyPlayingInputItem];
+ p_current_input = [[mainInstance playlistController] currentlyPlayingInputItem];
if (p_current_input) {
VLCPlaylistController *playlistController = aNotification.object;
[self continuePlaybackWhereYouLeftOff:p_current_input player:playlistController.playerController];
@@ -96,7 +95,7 @@
{
// On shutdown, input might not be dead yet. Cleanup actions like itunes playback
// and playback positon are done in different code paths (dealloc and appWillTerminate:).
- if ([_mainInstance isTerminating]) {
+ if ([[VLCMain sharedInstance] isTerminating]) {
return;
}
@@ -187,7 +186,7 @@
return;
}
- [[_mainInstance resumeDialog] showWindowWithItem:p_input_item
+ [[[VLCMain sharedInstance] resumeDialog] showWindowWithItem:p_input_item
withLastPosition:lastPosition.intValue
completionBlock:completionBlock];
More information about the vlc-commits
mailing list