Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
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 @@
...
@@ -28,7 +28,7 @@
/* This object is here to ensure safe inter thread communication */
/* This object is here to ensure safe inter thread communication */
@interface
VLCEventManager
:
NSObject
@interface
VLCEventManager
:
NSObject
{
{
NSMutableArray
*
messageQueue
;
NSMutableArray
*
messageQueue
;
pthread_t
dispatcherThread
;
pthread_t
dispatcherThread
;
pthread_mutex_t
queueLock
;
pthread_mutex_t
queueLock
;
pthread_cond_t
signalData
;
pthread_cond_t
signalData
;
...
...
extras/MacOSX/Framework/Sources/VLCEventManager.m
View file @
3767759a
...
@@ -63,7 +63,7 @@ static void * EventDispatcherMainLoop(void * user_data)
...
@@ -63,7 +63,7 @@ static void * EventDispatcherMainLoop(void * user_data)
{
{
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
struct
message
*
message
,
*
message_newer
=
NULL
;
struct
message
*
message
,
*
message_newer
=
NULL
;
NSData
*
dataMessage
;
NSData
*
dataMessage
;
int
i
;
int
i
;
/* Sleep a bit not to flood the interface */
/* Sleep a bit not to flood the interface */
...
@@ -72,7 +72,7 @@ static void * EventDispatcherMainLoop(void * user_data)
...
@@ -72,7 +72,7 @@ static void * EventDispatcherMainLoop(void * user_data)
pthread_mutex_lock
(
[
self
queueLock
]
);
pthread_mutex_lock
(
[
self
queueLock
]
);
/* Wait until we have something on the queue */
/* 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
]
);
pthread_cond_wait
(
[
self
signalData
],
[
self
queueLock
]
);
}
}
...
@@ -87,14 +87,14 @@ static void * EventDispatcherMainLoop(void * user_data)
...
@@ -87,14 +87,14 @@ static void * EventDispatcherMainLoop(void * user_data)
{
{
for
(
i
=
0
;
i
<
[[
self
messageQueue
]
count
]
-
1
;
i
++
)
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
&&
if
(
message_newer
->
type
==
VLCNotification
&&
message_newer
->
target
==
message
->
target
&&
message_newer
->
target
==
message
->
target
&&
[
message_newer
->
u
.
name
isEqualToString
:
message
->
u
.
name
]
)
[
message_newer
->
u
.
name
isEqualToString
:
message
->
u
.
name
]
)
{
{
[
message_newer
->
target
release
];
[
message_newer
->
target
release
];
[
message
->
u
.
name
release
];
[
message
_newer
->
u
.
name
release
];
[[
self
messageQueue
]
removeObjectAtIndex
:
i
];
[[
self
messageQueue
]
removeObjectAtIndex
:
i
];
i
--
;
i
--
;
continue
;
continue
;
}
}
...
@@ -112,8 +112,8 @@ static void * EventDispatcherMainLoop(void * user_data)
...
@@ -112,8 +112,8 @@ static void * EventDispatcherMainLoop(void * user_data)
message_newer
->
sel
==
message
->
sel
)
message_newer
->
sel
==
message
->
sel
)
{
{
if
(
!
newArg
)
if
(
!
newArg
)
newArg
=
[
NSMutableArray
arrayWithArray
:
message
->
u
.
object
];
newArg
=
[
NSMutableArray
arrayWithArray
:
message
->
u
.
object
];
[
newArg
addObjectsFromArray
:
message_newer
->
u
.
object
];
[
newArg
addObjectsFromArray
:
message_newer
->
u
.
object
];
[
message_newer
->
target
release
];
[
message_newer
->
target
release
];
[
message_newer
->
u
.
object
release
];
[
message_newer
->
u
.
object
release
];
[[
self
messageQueue
]
removeObjectAtIndex
:
i
];
[[
self
messageQueue
]
removeObjectAtIndex
:
i
];
...
@@ -142,7 +142,6 @@ static void * EventDispatcherMainLoop(void * user_data)
...
@@ -142,7 +142,6 @@ static void * EventDispatcherMainLoop(void * user_data)
else
else
[
self
performSelectorOnMainThread
:
@selector
(
callObjectMethodWithArgs
:)
withObject
:
[
dataMessage
retain
]
/* released in the call */
waitUntilDone
:
YES
];
[
self
performSelectorOnMainThread
:
@selector
(
callObjectMethodWithArgs
:)
withObject
:
[
dataMessage
retain
]
/* released in the call */
waitUntilDone
:
YES
];
pthread_mutex_lock
(
[
self
queueLock
]
);
pthread_mutex_lock
(
[
self
queueLock
]
);
[[
self
messageQueue
]
removeLastObject
];
[[
self
messageQueue
]
removeLastObject
];
pthread_mutex_unlock
(
[
self
queueLock
]
);
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