[vlc-commits] macosx: work-around a playlist core limitation, which doesn' t allow the UI to set the currently displayed root properly, so triggering a play can lead to unwanted results (close #7484)

Felix Paul Kühne git at videolan.org
Tue Sep 18 12:01:26 CEST 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Sep 18 11:58:23 2012 +0200| [99782f407f2e6bbfcc6648b292e05a6cc91569e9] | committer: Felix Paul Kühne

macosx: work-around a playlist core limitation, which doesn't allow the UI to set the currently displayed root properly, so triggering a play can lead to unwanted results (close #7484)
(cherry picked from commit 722c751deddeb6106ed18e379a1364ed85cd2f86)

Conflicts:
	modules/gui/macosx/CoreInteraction.m

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

 modules/gui/macosx/CoreInteraction.m |   29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/modules/gui/macosx/CoreInteraction.m b/modules/gui/macosx/CoreInteraction.m
index 580dd5d..7895eda 100644
--- a/modules/gui/macosx/CoreInteraction.m
+++ b/modules/gui/macosx/CoreInteraction.m
@@ -79,17 +79,24 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
 
 - (void)play
 {
-    playlist_t * p_playlist = pl_Get( VLCIntf );
-    bool empty;
-
-    PL_LOCK;
-    empty = playlist_IsEmpty( p_playlist );
-    PL_UNLOCK;
-
-    if( empty )
-        [[[VLCMain sharedInstance] open] openFileGeneric];
-
-    var_SetInteger( VLCIntf->p_libvlc, "key-action", ACTIONID_PLAY_PAUSE );
+    input_thread_t * p_input;
+    p_input = pl_CurrentInput(VLCIntf);
+    if (p_input) {
+        var_SetInteger(VLCIntf->p_libvlc, "key-action", ACTIONID_PLAY_PAUSE);
+        vlc_object_release(p_input);
+    } else {
+        playlist_t * p_playlist = pl_Get(VLCIntf);
+        bool empty;
+
+        PL_LOCK;
+        empty = playlist_IsEmpty(p_playlist);
+        PL_UNLOCK;
+
+        if ([[[VLCMain sharedInstance] playlist] isSelectionEmpty] && ([[[VLCMain sharedInstance] playlist] currentPlaylistRoot] == p_playlist->p_local_category || [[[VLCMain sharedInstance] playlist] currentPlaylistRoot] == p_playlist->p_ml_category))
+            [[[VLCMain sharedInstance] open] openFileGeneric];
+        else
+            [[[VLCMain sharedInstance] playlist] playItem:nil];
+    }
 }
 
 - (void)pause



More information about the vlc-commits mailing list