[vlc-commits] macosx: trust the user that s/he knows what s/he' s doing when opening a VIDEO_TS folder (close #6108)

Felix Paul Kühne git at videolan.org
Thu May 10 01:59:30 CEST 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu May 10 01:54:56 2012 +0200| [c4d228d601f8b9f8e08721285ac3f7a182699076] | committer: Felix Paul Kühne

macosx: trust the user that s/he knows what s/he's doing when opening a VIDEO_TS folder (close #6108)

in other words, accept folders which aren't named 'VIDEO_TS'
(cherry picked from commit 0fff26bc5eb641f04b882b6830099b9bd267124b)

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

 modules/gui/macosx/open.m |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/modules/gui/macosx/open.m b/modules/gui/macosx/open.m
index c17b81c..b9fa361 100644
--- a/modules/gui/macosx/open.m
+++ b/modules/gui/macosx/open.m
@@ -759,9 +759,9 @@ static VLCOpen *_o_sharedMainInstance = nil;
             returnValue = kVLCMediaBD;
         else
         {
-            if ([mountPath rangeOfString:@"VIDEO_TS"].location != NSNotFound)
+            if ([mountPath rangeOfString:@"VIDEO_TS" options:NSCaseInsensitiveSearch | NSBackwardsSearch].location != NSNotFound)
                 returnValue = kVLCMediaVideoTSFolder;
-            else if ([mountPath rangeOfString:@"BDMV"].location != NSNotFound)
+            else if ([mountPath rangeOfString:@"BDMV" options:NSCaseInsensitiveSearch | NSBackwardsSearch].location != NSNotFound)
                 returnValue = kVLCMediaBDMVFolder;
             else
             {
@@ -783,7 +783,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
                     }
                 }
                 if(!returnValue)
-                    returnValue = kVLCMediaUnknown;
+                    returnValue = kVLCMediaVideoTSFolder;
             }
         }
 
@@ -902,13 +902,8 @@ static VLCOpen *_o_sharedMainInstance = nil;
         NSString *o_path = [[[o_open_panel URLs] objectAtIndex: 0] path];
         if ([o_path length] > 0 )
         {
-            if ([o_path rangeOfString:@"VIDEO_TS"].location != NSNotFound || [o_path rangeOfString:@"BDMV"].location != NSNotFound)
-            {
-                [o_specialMediaFolders addObject: o_path];
-                [self scanOpticalMedia: nil];
-            }
-            else
-                msg_Dbg( VLCIntf, "chosen directory is no suitable special media folder" );
+            [o_specialMediaFolders addObject: o_path];
+            [self scanOpticalMedia: nil];
         }
     }
 }



More information about the vlc-commits mailing list