[vlc-commits] macosx/main menu: fix menu item validation for items depending on input capabilities

Felix Paul Kühne git at videolan.org
Mon Feb 11 14:30:55 CET 2019


vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Mon Feb 11 13:41:35 2019 +0100| [ad7e1e40914f6c2bb902c5dd9aca4d939fa9c6d7] | committer: Felix Paul Kühne

macosx/main menu: fix menu item validation for items depending on input capabilities

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

 modules/gui/macosx/menus/VLCMainMenu.m            |  1 +
 modules/gui/macosx/playlist/VLCPlayerController.m | 10 +++++-----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/gui/macosx/menus/VLCMainMenu.m b/modules/gui/macosx/menus/VLCMainMenu.m
index 3d5eeb1fab..6d1a92c363 100644
--- a/modules/gui/macosx/menus/VLCMainMenu.m
+++ b/modules/gui/macosx/menus/VLCMainMenu.m
@@ -95,6 +95,7 @@
 {
     _timeSelectionPanel = [[VLCTimeSelectionPanelController alloc] init];
     _playlistController = [[VLCMain sharedInstance] playlistController];
+    _playerController = _playlistController.playerController;
 
     /* check whether the user runs OSX with a RTL language */
     NSArray* languages = [NSLocale preferredLanguages];
diff --git a/modules/gui/macosx/playlist/VLCPlayerController.m b/modules/gui/macosx/playlist/VLCPlayerController.m
index 9f25e39b36..a2cde6f521 100644
--- a/modules/gui/macosx/playlist/VLCPlayerController.m
+++ b/modules/gui/macosx/playlist/VLCPlayerController.m
@@ -498,11 +498,11 @@ static const struct vlc_player_aout_cbs player_aout_callbacks = {
 
 - (void)capabilitiesChanged:(int)newCapabilities
 {
-    _seekable = newCapabilities & VLC_INPUT_CAPABILITIES_SEEKABLE;
-    _rewindable = newCapabilities & VLC_INPUT_CAPABILITIES_REWINDABLE;
-    _pausable = newCapabilities & VLC_INPUT_CAPABILITIES_PAUSEABLE;
-    _recordable = newCapabilities & VLC_INPUT_CAPABILITIES_RECORDABLE;
-    _rateChangable = newCapabilities & VLC_INPUT_CAPABILITIES_CHANGE_RATE;
+    _seekable = newCapabilities & VLC_INPUT_CAPABILITIES_SEEKABLE ? YES : NO;
+    _rewindable = newCapabilities & VLC_INPUT_CAPABILITIES_REWINDABLE ? YES : NO;
+    _pausable = newCapabilities & VLC_INPUT_CAPABILITIES_PAUSEABLE ? YES : NO;
+    _recordable = newCapabilities & VLC_INPUT_CAPABILITIES_RECORDABLE ? YES : NO;
+    _rateChangable = newCapabilities & VLC_INPUT_CAPABILITIES_CHANGE_RATE ? YES : NO;
     [_defaultNotificationCenter postNotificationName:VLCPlayerCapabilitiesChanged
                                               object:self];
 }



More information about the vlc-commits mailing list