[vlc-commits] macosx: fix bug in disk open panel regarding selected folders

David Fuhrmann git at videolan.org
Sun Jun 24 10:53:38 CEST 2012


vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Sun Jun 24 01:26:30 2012 +0200| [f8d14c628d05db37c286cc48ad44a2555dd53639] | committer: David Fuhrmann

macosx: fix bug in disk open panel regarding selected folders

Previously, the open panel always converted the mrl to an (not available)
mount point when you want to setup a playback without menus

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

 modules/gui/macosx/open.m |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/open.m b/modules/gui/macosx/open.m
index 9a66b59..82b1a2e 100644
--- a/modules/gui/macosx/open.m
+++ b/modules/gui/macosx/open.m
@@ -980,9 +980,18 @@ static VLCOpen *_o_sharedMainInstance = nil;
 
 - (IBAction)dvdreadOptionChanged:(id)sender
 {
+    NSString *o_device_path = [o_opticalDevices objectAtIndex: [o_disc_selector_pop indexOfSelectedItem]];
+    char *diskType = [self getVolumeTypeFromMountPath:o_device_path];
+
+    NSString *pathToOpen;
+    if (diskType == kVLCMediaVideoTSFolder)
+        pathToOpen = o_device_path;
+    else
+        pathToOpen = [self getBSDNodeFromMountPath: o_device_path];
+
     if (sender == o_disc_dvdwomenus_enablemenus_btn) {
         b_nodvdmenus = NO;
-        [self setMRL: [NSString stringWithFormat: @"dvdnav://%@", [self getBSDNodeFromMountPath:[o_opticalDevices objectAtIndex: [o_disc_selector_pop indexOfSelectedItem]]]]];
+        [self setMRL: [NSString stringWithFormat: @"dvdnav://%@", pathToOpen]];
         [self showOpticalMediaView: o_disc_dvd_view withIcon: [o_currentOpticalMediaIconView image]];
         return;
     }
@@ -1000,7 +1009,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
     if (sender == o_disc_dvdwomenus_chapter_stp)
         [o_disc_dvdwomenus_chapter setIntValue: [o_disc_dvdwomenus_chapter_stp intValue]];
 
-    [self setMRL: [NSString stringWithFormat: @"dvdread://%@#%i:%i-", [self getBSDNodeFromMountPath:[o_opticalDevices objectAtIndex: [o_disc_selector_pop indexOfSelectedItem]]], [o_disc_dvdwomenus_title intValue], [o_disc_dvdwomenus_chapter intValue]]];
+    [self setMRL: [NSString stringWithFormat: @"dvdread://%@#%i:%i-", pathToOpen, [o_disc_dvdwomenus_title intValue], [o_disc_dvdwomenus_chapter intValue]]];
 }
 
 - (IBAction)vcdOptionChanged:(id)sender



More information about the vlc-commits mailing list