Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
d86de10c
Commit
d86de10c
authored
Jun 24, 2012
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: disk open: do a shallow instead of a deep search for media directories
parent
ad09e6fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
12 deletions
+32
-12
modules/gui/macosx/open.m
modules/gui/macosx/open.m
+32
-12
No files found.
modules/gui/macosx/open.m
View file @
d86de10c
...
...
@@ -837,21 +837,41 @@ static VLCOpen *_o_sharedMainInstance = nil;
{
// NSFileManager is not thread-safe, don't use defaultManager outside of the main thread
NSFileManager
*
fm
=
[[
NSFileManager
alloc
]
init
];
NSArray
*
topLevelItems
;
topLevelItems
=
[
fm
subpathsOfDirectoryAtPath
:
mountPath
error
:
NULL
];
[
fm
release
];
NSUInteger
itemCount
=
[
topLevelItems
count
];
for
(
int
i
=
0
;
i
<
itemCount
;
i
++
)
{
if
([[
topLevelItems
objectAtIndex
:
i
]
rangeOfString
:
@"SVCD"
].
location
!=
NSNotFound
)
{
returnValue
=
kVLCMediaSVCD
;
break
;
}
if
([[
topLevelItems
objectAtIndex
:
i
]
rangeOfString
:
@"VCD"
].
location
!=
NSNotFound
)
{
returnValue
=
kVLCMediaVCD
;
break
;
NSArray
*
dirContents
=
[
fm
contentsOfDirectoryAtPath
:
mountPath
error
:
nil
];
for
(
int
i
=
0
;
i
<
[
dirContents
count
];
i
++
)
{
NSString
*
currentFile
=
[
dirContents
objectAtIndex
:
i
];
NSString
*
fullPath
=
[
mountPath
stringByAppendingPathComponent
:
currentFile
];
BOOL
isDir
;
if
([
fm
fileExistsAtPath
:
fullPath
isDirectory
:
&
isDir
]
&&
isDir
)
{
if
([
currentFile
caseInsensitiveCompare
:
@"SVCD"
]
==
NSOrderedSame
)
{
returnValue
=
kVLCMediaSVCD
;
break
;
}
if
([
currentFile
caseInsensitiveCompare
:
@"VCD"
]
==
NSOrderedSame
)
{
returnValue
=
kVLCMediaVCD
;
break
;
}
if
([
currentFile
caseInsensitiveCompare
:
@"BDMV"
]
==
NSOrderedSame
)
{
returnValue
=
kVLCMediaBDMVFolder
;
break
;
}
if
([
currentFile
caseInsensitiveCompare
:
@"VIDEO_TS"
]
==
NSOrderedSame
)
{
returnValue
=
kVLCMediaVideoTSFolder
;
break
;
}
}
}
[
fm
release
];
if
(
!
returnValue
)
returnValue
=
kVLCMediaVideoTSFolder
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment