Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
2c828226
Commit
2c828226
authored
Aug 15, 2011
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: saved various objc selector dispatches when iterating, additionally fixes #5113
parent
eab70f5d
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
108 additions
and
109 deletions
+108
-109
modules/access/qtcapture.m
modules/access/qtcapture.m
+5
-4
modules/gui/macosx/AppleRemote.m
modules/gui/macosx/AppleRemote.m
+4
-4
modules/gui/macosx/MainMenu.m
modules/gui/macosx/MainMenu.m
+2
-1
modules/gui/macosx/about.m
modules/gui/macosx/about.m
+2
-1
modules/gui/macosx/misc.m
modules/gui/macosx/misc.m
+12
-15
modules/gui/macosx/open.m
modules/gui/macosx/open.m
+9
-7
modules/gui/macosx/output.m
modules/gui/macosx/output.m
+6
-12
modules/gui/macosx/playlist.m
modules/gui/macosx/playlist.m
+46
-51
modules/gui/macosx/prefs.m
modules/gui/macosx/prefs.m
+18
-11
modules/gui/macosx/prefs_widgets.m
modules/gui/macosx/prefs_widgets.m
+2
-2
modules/gui/macosx/simple_prefs.m
modules/gui/macosx/simple_prefs.m
+2
-1
No files found.
modules/access/qtcapture.m
View file @
2c828226
...
...
@@ -246,11 +246,11 @@ static int Open( vlc_object_t *p_this )
goto
error
;
}
int
ivideo
;
for
(
ivideo
=
0
;
ivideo
<
[
myVideoDevices
count
]
;
ivideo
++
){
NSUInteger
deviceCount
=
[
myVideoDevices
count
]
;
for
(
NSUInteger
ivideo
=
0
;
ivideo
<
deviceCount
;
ivideo
++
){
QTCaptureDevice
*
qtk_device
;
qtk_device
=
[
myVideoDevices
objectAtIndex
:
ivideo
];
msg_Dbg
(
p_demux
,
"qtcapture %d/%lu %s %s"
,
ivideo
,
[
myVideoDevices
count
]
,
[[
qtk_device
localizedDisplayName
]
UTF8String
],
[[
qtk_device
uniqueID
]
UTF8String
]);
msg_Dbg
(
p_demux
,
"qtcapture %d/%lu %s %s"
,
ivideo
,
deviceCount
,
[[
qtk_device
localizedDisplayName
]
UTF8String
],
[[
qtk_device
uniqueID
]
UTF8String
]);
if
([[[
qtk_device
uniqueID
]
stringByTrimmingCharactersInSet
:[
NSCharacterSet
whitespaceCharacterSet
]]
isEqualToString
:
qtk_currdevice_uid
]){
break
;
}
...
...
@@ -302,7 +302,8 @@ static int Open( vlc_object_t *p_this )
/* Get the formats */
NSArray
*
format_array
=
[
p_sys
->
device
formatDescriptions
];
QTFormatDescription
*
camera_format
=
NULL
;
for
(
int
k
=
0
;
k
<
[
format_array
count
];
k
++
)
NSUInteger
formatCount
=
[
format_array
count
];
for
(
NSUInteger
k
=
0
;
k
<
formatCount
;
k
++
)
{
camera_format
=
[
format_array
objectAtIndex
:
k
];
...
...
modules/gui/macosx/AppleRemote.m
View file @
2c828226
...
...
@@ -627,8 +627,8 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
memset(cookies, 0, sizeof(IOHIDElementCookie) * NUMBER_OF_APPLE_REMOTE_ACTIONS);
*/
allCookies
=
[[
NSMutableArray
alloc
]
init
];
unsigned
int
i
;
for
(
i
=
0
;
i
<
[
elements
count
]
;
i
++
)
{
NSUInteger
elementCount
=
[
elements
count
]
;
for
(
NSUInteger
i
=
0
;
i
<
elementCount
;
i
++
)
{
element
=
[
elements
objectAtIndex
:
i
];
//Get cookie
...
...
@@ -668,8 +668,8 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
if
(
queue
)
{
result
=
(
*
queue
)
->
create
(
queue
,
0
,
12
);
//depth: maximum number of elements in queue before oldest elements in queue begin to be lost.
unsigned
int
i
=
0
;
for
(
i
=
0
;
i
<
[
allCookies
count
]
;
i
++
)
{
NSUInteger
cookieCount
=
[
allCookies
count
]
;
for
(
NSUInteger
i
=
0
;
i
<
cookieCount
;
i
++
)
{
IOHIDElementCookie
cookie
=
(
IOHIDElementCookie
)[[
allCookies
objectAtIndex
:
i
]
intValue
];
(
*
queue
)
->
addElement
(
queue
,
cookie
,
0
);
}
...
...
modules/gui/macosx/MainMenu.m
View file @
2c828226
...
...
@@ -375,7 +375,8 @@ static VLCMainMenu *_o_sharedInstance = nil;
if
(
!
p_intf
)
return
;
NSArray
*
menuitems_array
=
[
the_menu
itemArray
];
for
(
int
i
=
0
;
i
<
[
menuitems_array
count
];
i
++
)
NSUInteger
menuItemCount
=
[
menuitems_array
count
];
for
(
NSUInteger
i
=
0
;
i
<
menuItemCount
;
i
++
)
{
NSMenuItem
*
one_item
=
[
menuitems_array
objectAtIndex
:
i
];
if
(
[
one_item
hasSubmenu
]
)
...
...
modules/gui/macosx/about.m
View file @
2c828226
...
...
@@ -106,7 +106,8 @@ static VLAboutBox *_o_sharedInstance = nil;
[
o_name_version_field
setStringValue
:
[
NSString
stringWithFormat
:
@"Version %s (%s)"
,
VERSION_MESSAGE
,
PLATFORM
]];
NSMutableArray
*
tmpArray
=
[
NSMutableArray
arrayWithArray
:
[[
NSString
stringWithUTF8String
:
psz_authors
]
componentsSeparatedByString
:
@"
\n\n
"
]];
for
(
int
i
=
0
;
i
<
[
tmpArray
count
];
i
++
)
NSUInteger
count
=
[
tmpArray
count
];
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
[
tmpArray
replaceObjectAtIndex
:
i
withObject
:[[
tmpArray
objectAtIndex
:
i
]
stringByReplacingOccurrencesOfString
:
@"
\n
"
withString
:
@", "
]];
[
tmpArray
replaceObjectAtIndex
:
i
withObject
:[[
tmpArray
objectAtIndex
:
i
]
stringByReplacingOccurrencesOfString
:
@", -"
withString
:
@"
\n
-"
options
:
0
range
:
NSRangeFromString
(
@"0 30"
)]];
...
...
modules/gui/macosx/misc.m
View file @
2c828226
...
...
@@ -83,9 +83,9 @@ static NSMutableArray *blackoutWindows = NULL;
+
(
NSScreen
*
)
screenWithDisplayID
:
(
CGDirectDisplayID
)
displayID
{
int
i
;
NSUInteger
count
=
[[
NSScreen
screens
]
count
]
;
for
(
i
=
0
;
i
<
[[
NSScreen
screens
]
count
]
;
i
++
)
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
NSScreen
*
screen
=
[[
NSScreen
screens
]
objectAtIndex
:
i
];
if
([
screen
displayID
]
==
displayID
)
...
...
@@ -111,13 +111,12 @@ static NSMutableArray *blackoutWindows = NULL;
-
(
void
)
blackoutOtherScreens
{
unsigned
int
i
;
/* Free our previous blackout window (follow blackoutWindow alloc strategy) */
[
blackoutWindows
makeObjectsPerformSelector
:
@selector
(
close
)];
[
blackoutWindows
removeAllObjects
];
for
(
i
=
0
;
i
<
[[
NSScreen
screens
]
count
];
i
++
)
NSUInteger
screenCount
=
[[
NSScreen
screens
]
count
];
for
(
NSUInteger
i
=
0
;
i
<
screenCount
;
i
++
)
{
NSScreen
*
screen
=
[[
NSScreen
screens
]
objectAtIndex
:
i
];
VLCWindow
*
blackoutWindow
;
...
...
@@ -151,9 +150,9 @@ static NSMutableArray *blackoutWindows = NULL;
+
(
void
)
unblackoutScreens
{
unsigned
int
i
;
NSUInteger
blackoutWindowCount
=
[
blackoutWindows
count
]
;
for
(
i
=
0
;
i
<
[
blackoutWindows
count
]
;
i
++
)
for
(
NSUInteger
i
=
0
;
i
<
blackoutWindowCount
;
i
++
)
{
VLCWindow
*
blackoutWindow
=
[
blackoutWindows
objectAtIndex
:
i
];
[
blackoutWindow
closeAndAnimate
:
YES
];
...
...
@@ -398,12 +397,11 @@ static NSMutableArray *blackoutWindows = NULL;
{
if
([
o_desired_type
isEqualToString
:
NSFilenamesPboardType
])
{
int
i
;
NSArray
*
o_array
=
[
NSArray
array
];
NSArray
*
o_values
=
[[
o_paste
propertyListForType
:
NSFilenamesPboardType
]
sortedArrayUsingSelector:
@selector
(
caseInsensitiveCompare
:)
];
NSArray
*
o_values
=
[[
o_paste
propertyListForType
:
NSFilenamesPboardType
]
sortedArrayUsingSelector
:
@selector
(
caseInsensitiveCompare
:)];
NSUInteger
count
=
[
o_values
count
];
for
(
i
=
0
;
i
<
(
int
)[
o_values
count
]
;
i
++
)
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
NSDictionary
*
o_dic
;
char
*
psz_uri
=
make_URI
([[
o_values
objectAtIndex
:
i
]
UTF8String
],
NULL
);
...
...
@@ -483,12 +481,11 @@ static NSMutableArray *blackoutWindows = NULL;
{
if
([
o_desired_type
isEqualToString
:
NSFilenamesPboardType
])
{
int
i
;
NSArray
*
o_array
=
[
NSArray
array
];
NSArray
*
o_values
=
[[
o_paste
propertyListForType
:
NSFilenamesPboardType
]
sortedArrayUsingSelector:
@selector
(
caseInsensitiveCompare
:)
];
NSArray
*
o_values
=
[[
o_paste
propertyListForType
:
NSFilenamesPboardType
]
sortedArrayUsingSelector
:
@selector
(
caseInsensitiveCompare
:)];
NSUInteger
count
=
[
o_values
count
];
for
(
i
=
0
;
i
<
(
int
)[
o_values
count
]
;
i
++
)
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
NSDictionary
*
o_dic
;
char
*
psz_uri
=
make_URI
([[
o_values
objectAtIndex
:
i
]
UTF8String
],
NULL
);
...
...
modules/gui/macosx/open.m
View file @
2c828226
...
...
@@ -211,7 +211,8 @@ static VLCOpen *_o_sharedMainInstance = nil;
qtk_currdevice_uid
=
[[[
QTCaptureDevice
defaultInputDeviceWithMediaType
:
QTMediaTypeVideo
]
uniqueID
]
stringByTrimmingCharactersInSet:
[
NSCharacterSet
whitespaceCharacterSet
]];
}
for
(
int
ivideo
=
0
;
ivideo
<
[
qtkvideoDevices
count
];
ivideo
++
){
NSUInteger
deviceCount
=
[
qtkvideoDevices
count
];
for
(
int
ivideo
=
0
;
ivideo
<
deviceCount
;
ivideo
++
){
QTCaptureDevice
*
qtk_device
;
qtk_device
=
[
qtkvideoDevices
objectAtIndex
:
ivideo
];
[
o_qtk_device_pop
addItemWithTitle
:
[
qtk_device
localizedDisplayName
]];
...
...
@@ -368,7 +369,6 @@ static VLCOpen *_o_sharedMainInstance = nil;
{
NSMutableDictionary
*
o_dic
;
NSMutableArray
*
o_options
=
[
NSMutableArray
array
];
unsigned
int
i
;
o_dic
=
[
NSMutableDictionary
dictionaryWithObject
:
[
self
MRL
]
forKey
:
@"ITEM_URL"
];
if
(
[
o_file_sub_ckbox
state
]
==
NSOnState
)
...
...
@@ -400,10 +400,10 @@ static VLCOpen *_o_sharedMainInstance = nil;
}
if
(
[
o_output_ckbox
state
]
==
NSOnState
)
{
for
(
i
=
0
;
i
<
[[
o_sout_options
mrl
]
count
]
;
i
++
)
NSUInteger
count
=
[[
o_sout_options
mrl
]
count
];
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
[
o_options
addObject
:
[
NSString
stringWithString
:
[[(
VLCOutput
*
)
o_sout_options
mrl
]
objectAtIndex
:
i
]]];
[
o_options
addObject
:
[
NSString
stringWithString
:
[[(
VLCOutput
*
)
o_sout_options
mrl
]
objectAtIndex
:
i
]]];
}
}
if
(
[
o_file_slave_ckbox
state
]
&&
o_file_slave_path
)
...
...
@@ -752,7 +752,8 @@ static VLCOpen *_o_sharedMainInstance = nil;
{
NSArray
*
topLevelItems
;
topLevelItems
=
[[
NSFileManager
defaultManager
]
subpathsOfDirectoryAtPath
:
mountPath
error
:
NULL
];
for
(
int
i
=
0
;
i
<
[
topLevelItems
count
];
i
++
)
{
NSUInteger
itemCount
=
[
topLevelItems
count
];
for
(
int
i
=
0
;
i
<
itemCount
;
i
++
)
{
if
([[
topLevelItems
objectAtIndex
:
i
]
rangeOfString
:
@"SVCD"
].
location
!=
NSNotFound
)
{
returnValue
=
kVLCMediaSVCD
;
break
;
...
...
@@ -835,7 +836,8 @@ static VLCOpen *_o_sharedMainInstance = nil;
if
([
o_specialMediaFolders
count
]
>
0
)
[
o_opticalDevices
addObjectsFromArray
:
o_specialMediaFolders
];
if
([
o_opticalDevices
count
]
>
0
)
{
for
(
int
i
=
0
;
i
<
[
o_opticalDevices
count
]
;
i
++
)
NSUInteger
deviceCount
=
[
o_opticalDevices
count
];
for
(
NSUInteger
i
=
0
;
i
<
deviceCount
;
i
++
)
[
o_disc_selector_pop
addItemWithTitle
:
[[
NSFileManager
defaultManager
]
displayNameAtPath
:[
o_opticalDevices
objectAtIndex
:
i
]]];
if
([
o_disc_selector_pop
numberOfItems
]
<=
1
)
...
...
modules/gui/macosx/output.m
View file @
2c828226
...
...
@@ -416,27 +416,21 @@
/* split up the hostname and the following path to paste the
* port correctly. Not need, if there isn't any path following the
* hostname. */
NSArray
*
o_urlItems
=
[[
o_stream_address
stringValue
]
\
componentsSeparatedByString
:
@"/"
];
NSArray
*
o_urlItems
=
[[
o_stream_address
stringValue
]
componentsSeparatedByString
:
@"/"
];
NSMutableString
*
o_finalStreamAddress
;
o_finalStreamAddress
=
[[
NSMutableString
alloc
]
init
];
if
([
o_urlItems
count
]
==
1
)
{
[
o_finalStreamAddress
appendFormat
:
@"
\"
%@:%@
\"
"
,
\
[
o_stream_address
stringValue
],[
o_stream_port
stringValue
]];
[
o_finalStreamAddress
appendFormat
:
@"
\"
%@:%@
\"
"
,
[
o_stream_address
stringValue
],[
o_stream_port
stringValue
]];
}
else
{
[
o_finalStreamAddress
appendFormat
:
@"
\"
%@:%@"
,
[
o_urlItems
\
objectAtIndex
:
0
],
[
o_stream_port
stringValue
]];
unsigned
int
x
;
x
=
1
;
while
(
x
!=
[
o_urlItems
count
])
[
o_finalStreamAddress
appendFormat
:
@"
\"
%@:%@"
,
[
o_urlItems
objectAtIndex
:
0
],
[
o_stream_port
stringValue
]];
NSUInteger
itemCount
=
[
o_urlItems
count
];
for
(
NSUInteger
x
=
0
;
x
<
itemCount
;
x
++
)
{
[
o_finalStreamAddress
appendFormat
:
@"/%@"
,
[
o_urlItems
\
objectAtIndex
:
x
]];
x
=
(
x
+
1
);
[
o_finalStreamAddress
appendFormat
:
@"/%@"
,
[
o_urlItems
objectAtIndex
:
x
]];
}
[
o_finalStreamAddress
appendString
:
@"
\"
"
];
}
...
...
modules/gui/macosx/playlist.m
View file @
2c828226
This diff is collapsed.
Click to expand it.
modules/gui/macosx/prefs.m
View file @
2c828226
...
...
@@ -295,7 +295,8 @@ static VLCPrefs *_o_sharedMainInstance = nil;
-
(
VLCTreeCategoryItem
*
)
itemRepresentingCategory
:(
int
)
category
{
for
(
int
i
=
0
;
i
<
[[
self
children
]
count
];
i
++
)
NSUInteger
childrenCount
=
[[
self
children
]
count
];
for
(
int
i
=
0
;
i
<
childrenCount
;
i
++
)
{
VLCTreeCategoryItem
*
categoryItem
=
[[
self
children
]
objectAtIndex
:
i
];
if
(
[
categoryItem
category
]
==
category
)
...
...
@@ -433,7 +434,8 @@ static VLCPrefs *_o_sharedMainInstance = nil;
-
(
VLCTreeSubCategoryItem
*
)
itemRepresentingSubCategory
:(
int
)
subCategory
{
assert
(
[
self
isKindOfClass
:[
VLCTreeCategoryItem
class
]]
);
for
(
int
i
=
0
;
i
<
[[
self
children
]
count
];
i
++
)
NSUInteger
childrenCount
=
[[
self
children
]
count
];
for
(
NSUInteger
i
=
0
;
i
<
childrenCount
;
i
++
)
{
VLCTreeSubCategoryItem
*
subCategoryItem
=
[[
self
children
]
objectAtIndex
:
i
];
if
(
[
subCategoryItem
subCategory
]
==
subCategory
)
...
...
@@ -584,8 +586,8 @@ static VLCPrefs *_o_sharedMainInstance = nil;
{
_subviews
=
[[
NSMutableArray
alloc
]
initWithCapacity
:
10
];
long
i
;
for
(
i
=
0
;
i
<
[[
self
options
]
count
]
;
i
++
)
NSUInteger
count
=
[[
self
options
]
count
]
;
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
VLCTreeLeafItem
*
item
=
[[
self
options
]
objectAtIndex
:
i
];
...
...
@@ -638,24 +640,29 @@ static VLCPrefs *_o_sharedMainInstance = nil;
-
(
void
)
applyChanges
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
[
_subviews
count
]
;
i
++
)
NSUInteger
i
;
NSUInteger
count
=
[
_subviews
count
];
for
(
i
=
0
;
i
<
count
;
i
++
)
[[
_subviews
objectAtIndex
:
i
]
applyChanges
];
for
(
i
=
0
;
i
<
[
_children
count
]
;
i
++
)
count
=
[
_children
count
];
for
(
i
=
0
;
i
<
count
;
i
++
)
[[
_children
objectAtIndex
:
i
]
applyChanges
];
}
-
(
void
)
resetView
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
[
_subviews
count
]
;
i
++
)
NSUInteger
i
;
NSUInteger
count
=
[
_subviews
count
];
for
(
i
=
0
;
i
<
count
;
i
++
)
[[
_subviews
objectAtIndex
:
i
]
resetValues
];
for
(
i
=
0
;
i
<
[
_options
count
]
;
i
++
)
count
=
[
_options
count
];
for
(
i
=
0
;
i
<
count
;
i
++
)
[[
_options
objectAtIndex
:
i
]
resetView
];
for
(
i
=
0
;
i
<
[
_children
count
]
;
i
++
)
count
=
[
_children
count
];
for
(
i
=
0
;
i
<
count
;
i
++
)
[[
_children
objectAtIndex
:
i
]
resetView
];
}
...
...
modules/gui/macosx/prefs_widgets.m
View file @
2c828226
...
...
@@ -2308,8 +2308,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
-
(
IBAction
)
tableChanged
:(
id
)
sender
{
NSString
*
o_newstring
=
@""
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
[
o_modulearray
count
]
;
i
++
)
NSUInteger
count
=
[
o_modulearray
count
]
;
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
if
(
[[[
o_modulearray
objectAtIndex
:
i
]
objectAtIndex
:
2
]
boolValue
]
!=
NO
)
{
...
...
modules/gui/macosx/simple_prefs.m
View file @
2c828226
...
...
@@ -916,7 +916,8 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
********************/
if
(
b_hotkeyChanged
)
{
for
(
NSUInteger
i
=
0
;
i
<
[
o_hotkeySettings
count
];
i
++
)
NSUInteger
hotKeyCount
=
[
o_hotkeySettings
count
];
for
(
NSUInteger
i
=
0
;
i
<
hotKeyCount
;
i
++
)
config_PutPsz
(
p_intf
,
[[
o_hotkeyNames
objectAtIndex
:
i
]
UTF8String
],
[[
o_hotkeySettings
objectAtIndex
:
i
]
UTF8String
]
);
b_hotkeyChanged
=
NO
;
}
...
...
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