vlc | branch: master | David Fuhrmann <[email protected]> | Sat Jun 27 
14:51:02 2015 +0200| [ff4982c01902e66818c4e008660c86cd58722f30] | committer: 
David Fuhrmann

macosx: always delete stored input thread on change (close #14850)

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

 modules/gui/macosx/intf.m |   39 +++++++++++++++++++--------------------
 1 file changed, 19 insertions(+), 20 deletions(-)

diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 3d901d8..3225a86 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -1320,9 +1320,7 @@ static VLCMain *_o_sharedMainInstance = nil;
 // This must be called on main thread
 - (void)PlaylistItemChanged
 {
-    input_thread_t *p_input_changed = NULL;
-
-    if (p_current_input && p_current_input->b_dead) {
+    if (p_current_input) {
         var_DelCallback(p_current_input, "intf-event", InputEvent, [VLCMain 
sharedInstance]);
         vlc_object_release(p_current_input);
         p_current_input = NULL;
@@ -1332,27 +1330,28 @@ static VLCMain *_o_sharedMainInstance = nil;
         [[NSNotificationCenter defaultCenter] 
postNotificationName:VLCInputChangedNotification
                                                             object:nil];
     }
-    else if (!p_current_input) {
-        // object is hold here and released then it is dead
-        p_current_input = playlist_CurrentInput(pl_Get(VLCIntf));
-        if (p_current_input) {
-            var_AddCallback(p_current_input, "intf-event", InputEvent, 
[VLCMain sharedInstance]);
-            [self playbackStatusUpdated];
-            [o_mainmenu setRateControlsEnabled: YES];
-
-            if ([self activeVideoPlayback] && [[o_mainwindow videoView] 
isHidden]) {
-                [o_mainwindow changePlaylistState: psPlaylistItemChangedEvent];
-            }
 
-            p_input_changed = vlc_object_hold(p_current_input);
-
-            [[self playlist] currentlyPlayingItemChanged];
+    input_thread_t *p_input_changed = NULL;
 
-            [[self playlist] continuePlaybackWhereYouLeftOff:p_current_input];
+    // object is hold here and released then it is dead
+    p_current_input = playlist_CurrentInput(pl_Get(VLCIntf));
+    if (p_current_input) {
+        var_AddCallback(p_current_input, "intf-event", InputEvent, [VLCMain 
sharedInstance]);
+        [self playbackStatusUpdated];
+        [o_mainmenu setRateControlsEnabled: YES];
 
-            [[NSNotificationCenter defaultCenter] 
postNotificationName:VLCInputChangedNotification
-                                                                object:nil];
+        if ([self activeVideoPlayback] && [[o_mainwindow videoView] isHidden]) 
{
+            [o_mainwindow changePlaylistState: psPlaylistItemChangedEvent];
         }
+
+        p_input_changed = vlc_object_hold(p_current_input);
+
+        [[self playlist] currentlyPlayingItemChanged];
+
+        [[self playlist] continuePlaybackWhereYouLeftOff:p_current_input];
+
+        [[NSNotificationCenter defaultCenter] 
postNotificationName:VLCInputChangedNotification
+                                                            object:nil];
     }
 
     [self updateMetaAndInfo];

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to