Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
3767759a
Commit
3767759a
authored
Jan 02, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MacOSX/Framework/VLCEventManager: Code cleanup. (Patch by Enrique Osuna).
parent
55bc65e1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
extras/MacOSX/Framework/Headers/Internal/VLCEventManager.h
extras/MacOSX/Framework/Headers/Internal/VLCEventManager.h
+1
-1
extras/MacOSX/Framework/Sources/VLCEventManager.m
extras/MacOSX/Framework/Sources/VLCEventManager.m
+7
-8
No files found.
extras/MacOSX/Framework/Headers/Internal/VLCEventManager.h
View file @
3767759a
...
...
@@ -28,7 +28,7 @@
/* This object is here to ensure safe inter thread communication */
@interface
VLCEventManager
:
NSObject
{
NSMutableArray
*
messageQueue
;
NSMutableArray
*
messageQueue
;
pthread_t
dispatcherThread
;
pthread_mutex_t
queueLock
;
pthread_cond_t
signalData
;
...
...
extras/MacOSX/Framework/Sources/VLCEventManager.m
View file @
3767759a
...
...
@@ -63,7 +63,7 @@ static void * EventDispatcherMainLoop(void * user_data)
{
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
struct
message
*
message
,
*
message_newer
=
NULL
;
NSData
*
dataMessage
;
NSData
*
dataMessage
;
int
i
;
/* Sleep a bit not to flood the interface */
...
...
@@ -72,7 +72,7 @@ static void * EventDispatcherMainLoop(void * user_data)
pthread_mutex_lock
(
[
self
queueLock
]
);
/* Wait until we have something on the queue */
while
([[
self
messageQueue
]
count
]
<=
0
)
while
(
[[
self
messageQueue
]
count
]
<=
0
)
{
pthread_cond_wait
(
[
self
signalData
],
[
self
queueLock
]
);
}
...
...
@@ -87,14 +87,14 @@ static void * EventDispatcherMainLoop(void * user_data)
{
for
(
i
=
0
;
i
<
[[
self
messageQueue
]
count
]
-
1
;
i
++
)
{
message_newer
=
(
struct
message
*
)[(
NSData
*
)[[
self
messageQueue
]
objectAtIndex
:
i
]
bytes
];
message_newer
=
(
struct
message
*
)[(
NSData
*
)[[
self
messageQueue
]
objectAtIndex
:
i
]
bytes
];
if
(
message_newer
->
type
==
VLCNotification
&&
message_newer
->
target
==
message
->
target
&&
[
message_newer
->
u
.
name
isEqualToString
:
message
->
u
.
name
]
)
{
[
message_newer
->
target
release
];
[
message
->
u
.
name
release
];
[[
self
messageQueue
]
removeObjectAtIndex
:
i
];
[
message
_newer
->
u
.
name
release
];
[[
self
messageQueue
]
removeObjectAtIndex
:
i
];
i
--
;
continue
;
}
...
...
@@ -112,8 +112,8 @@ static void * EventDispatcherMainLoop(void * user_data)
message_newer
->
sel
==
message
->
sel
)
{
if
(
!
newArg
)
newArg
=
[
NSMutableArray
arrayWithArray
:
message
->
u
.
object
];
[
newArg
addObjectsFromArray
:
message_newer
->
u
.
object
];
newArg
=
[
NSMutableArray
arrayWithArray
:
message
->
u
.
object
];
[
newArg
addObjectsFromArray
:
message_newer
->
u
.
object
];
[
message_newer
->
target
release
];
[
message_newer
->
u
.
object
release
];
[[
self
messageQueue
]
removeObjectAtIndex
:
i
];
...
...
@@ -142,7 +142,6 @@ static void * EventDispatcherMainLoop(void * user_data)
else
[
self
performSelectorOnMainThread
:
@selector
(
callObjectMethodWithArgs
:)
withObject
:
[
dataMessage
retain
]
/* released in the call */
waitUntilDone
:
YES
];
pthread_mutex_lock
(
[
self
queueLock
]
);
[[
self
messageQueue
]
removeLastObject
];
pthread_mutex_unlock
(
[
self
queueLock
]
);
...
...
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