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
62166376
Commit
62166376
authored
Jan 26, 2014
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: be more tolerant when checking for physical device (fixes #6253)
parent
bfa8edd8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
45 deletions
+49
-45
modules/gui/macosx/open.m
modules/gui/macosx/open.m
+49
-45
No files found.
modules/gui/macosx/open.m
View file @
62166376
...
...
@@ -886,10 +886,10 @@ static VLCOpen *_o_sharedMainInstance = nil;
if
(
noErr
==
err
)
actualVolume
=
catalogInfo
.
volume
;
else
return
NULL
;
goto
out
;
}
else
return
NULL
;
goto
out
;
GetVolParmsInfoBuffer
volumeParms
;
err
=
FSGetVolumeParms
(
actualVolume
,
&
volumeParms
,
sizeof
(
volumeParms
));
...
...
@@ -897,66 +897,70 @@ static VLCOpen *_o_sharedMainInstance = nil;
CFMutableDictionaryRef
matchingDict
;
io_service_t
service
;
if
(
!
volumeParms
.
vMDeviceID
)
return
NULL
;
if
(
!
volumeParms
.
vMDeviceID
)
{
goto
out
;
}
matchingDict
=
IOBSDNameMatching
(
kIOMasterPortDefault
,
0
,
volumeParms
.
vMDeviceID
);
service
=
IOServiceGetMatchingService
(
kIOMasterPortDefault
,
matchingDict
);
NSString
*
returnValue
;
NSString
*
returnValue
=
nil
;
if
(
IO_OBJECT_NULL
!=
service
)
{
if
(
IOObjectConformsTo
(
service
,
kIOCDMediaClass
))
{
if
(
IOObjectConformsTo
(
service
,
kIOCDMediaClass
))
returnValue
=
kVLCMediaAudioCD
;
}
else
if
(
IOObjectConformsTo
(
service
,
kIODVDMediaClass
))
returnValue
=
kVLCMediaDVD
;
else
if
(
IOObjectConformsTo
(
service
,
kIOBDMediaClass
))
returnValue
=
kVLCMediaBD
;
else
{
if
([
mountPath
rangeOfString
:
@"VIDEO_TS"
options
:
NSCaseInsensitiveSearch
|
NSBackwardsSearch
].
location
!=
NSNotFound
)
returnValue
=
kVLCMediaVideoTSFolder
;
else
if
([
mountPath
rangeOfString
:
@"BDMV"
options
:
NSCaseInsensitiveSearch
|
NSBackwardsSearch
].
location
!=
NSNotFound
)
returnValue
=
kVLCMediaBDMVFolder
;
else
{
// NSFileManager is not thread-safe, don't use defaultManager outside of the main thread
NSFileManager
*
fm
=
[[
NSFileManager
alloc
]
init
];
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
;
}
}
}
IOObjectRelease
(
service
);
[
fm
release
];
if
(
returnValue
)
return
returnValue
;
}
if
(
!
returnValue
)
out:
if
([
mountPath
rangeOfString
:
@"VIDEO_TS"
options
:
NSCaseInsensitiveSearch
|
NSBackwardsSearch
].
location
!=
NSNotFound
)
returnValue
=
kVLCMediaVideoTSFolder
;
else
if
([
mountPath
rangeOfString
:
@"BDMV"
options
:
NSCaseInsensitiveSearch
|
NSBackwardsSearch
].
location
!=
NSNotFound
)
returnValue
=
kVLCMediaBDMVFolder
;
else
{
// NSFileManager is not thread-safe, don't use defaultManager outside of the main thread
NSFileManager
*
fm
=
[[
NSFileManager
alloc
]
init
];
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
;
}
}
}
IOObjectRelease
(
service
);
[
fm
release
];
if
(
!
returnValue
)
returnValue
=
kVLCMediaVideoTSFolder
;
}
return
returnValue
;
}
...
...
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