[vlc-commits] macosx: Cancel resume dialog as well in case current input ends

David Fuhrmann git at videolan.org
Sun Jul 3 19:29:35 CEST 2016


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sun Jul  3 19:28:25 2016 +0200| [cd469ede8c4832463fb983158bb7d42cdd191f6e] | committer: David Fuhrmann

macosx: Cancel resume dialog as well in case current input ends

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cd469ede8c4832463fb983158bb7d42cdd191f6e
---

 modules/gui/macosx/InputManager.m           |    4 ++++
 modules/gui/macosx/ResumeDialogController.m |    3 +++
 modules/gui/macosx/VLCPlaylist.m            |    2 --
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/InputManager.m b/modules/gui/macosx/InputManager.m
index 9cff0e4..26fe1ed 100644
--- a/modules/gui/macosx/InputManager.m
+++ b/modules/gui/macosx/InputManager.m
@@ -29,6 +29,7 @@
 #import "MainWindow.h"
 #import "VLCPlaylist.h"
 #import "VLCPlaylistInfo.h"
+#import "ResumeDialogController.h"
 #import "TrackSynchronization.h"
 #import "VideoView.h"
 
@@ -199,6 +200,9 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
                                                             object:nil];
     }
 
+    // Cancel pending resume dialogs
+    [[[VLCMain sharedInstance] resumeDialog] cancel];
+
     input_thread_t *p_input_changed = NULL;
 
     // object is hold here and released then it is dead
diff --git a/modules/gui/macosx/ResumeDialogController.m b/modules/gui/macosx/ResumeDialogController.m
index 1dc0a5a..5031c89 100644
--- a/modules/gui/macosx/ResumeDialogController.m
+++ b/modules/gui/macosx/ResumeDialogController.m
@@ -129,6 +129,9 @@
 
 - (void)cancel
 {
+    if (![self isWindowLoaded])
+        return;
+
     if (o_countdown_timer != nil) {
         [o_countdown_timer invalidate];
         o_countdown_timer = nil;
diff --git a/modules/gui/macosx/VLCPlaylist.m b/modules/gui/macosx/VLCPlaylist.m
index 1c439bf..d71c133 100644
--- a/modules/gui/macosx/VLCPlaylist.m
+++ b/modules/gui/macosx/VLCPlaylist.m
@@ -867,8 +867,6 @@
 
 - (void)continuePlaybackWhereYouLeftOff:(input_thread_t *)p_input_thread
 {
-   [[[VLCMain sharedInstance] resumeDialog] cancel];
-
     NSDictionary *recentlyPlayedFiles = [[NSUserDefaults standardUserDefaults] objectForKey:@"recentlyPlayedMedia"];
     if (!recentlyPlayedFiles)
         return;



More information about the vlc-commits mailing list