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
4e1d5325
Commit
4e1d5325
authored
May 07, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove libvlc_InternalWait() and simplify
parent
93143da0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
38 deletions
+14
-38
lib/core.c
lib/core.c
+12
-2
src/libvlccore.sym
src/libvlccore.sym
+0
-1
src/misc/exit.c
src/misc/exit.c
+2
-35
No files found.
lib/core.c
View file @
4e1d5325
...
...
@@ -136,10 +136,20 @@ void libvlc_set_exit_handler( libvlc_instance_t *p_i, void (*cb) (void *),
libvlc_SetExitHandler
(
p_libvlc
,
cb
,
data
);
}
static
void
libvlc_wait_wakeup
(
void
*
data
)
{
vlc_sem_post
(
data
);
}
void
libvlc_wait
(
libvlc_instance_t
*
p_i
)
{
libvlc_int_t
*
p_libvlc
=
p_i
->
p_libvlc_int
;
libvlc_InternalWait
(
p_libvlc
);
vlc_sem_t
sem
;
vlc_sem_init
(
&
sem
,
0
);
libvlc_set_exit_handler
(
p_i
,
libvlc_wait_wakeup
,
&
sem
);
vlc_sem_wait
(
&
sem
);
libvlc_set_exit_handler
(
p_i
,
NULL
,
NULL
);
vlc_sem_destroy
(
&
sem
);
}
void
libvlc_set_user_agent
(
libvlc_instance_t
*
p_i
,
...
...
src/libvlccore.sym
View file @
4e1d5325
...
...
@@ -225,7 +225,6 @@ libvlc_InternalCleanup
libvlc_InternalCreate
libvlc_InternalDestroy
libvlc_InternalInit
libvlc_InternalWait
libvlc_Quit
libvlc_SetExitHandler
make_URI
...
...
src/misc/exit.c
View file @
4e1d5325
...
...
@@ -43,9 +43,6 @@ void vlc_ExitDestroy( vlc_exit_t *exit )
/**
* Registers a callback for the LibVLC exit event.
*
* @note This function conflicts with libvlc_InternalWait().
* Use either or none of them, but not both.
*/
void
libvlc_SetExitHandler
(
libvlc_int_t
*
p_libvlc
,
void
(
*
handler
)
(
void
*
),
void
*
opaque
)
...
...
@@ -53,7 +50,7 @@ void libvlc_SetExitHandler( libvlc_int_t *p_libvlc, void (*handler) (void *),
vlc_exit_t
*
exit
=
&
libvlc_priv
(
p_libvlc
)
->
exit
;
vlc_mutex_lock
(
&
exit
->
lock
);
if
(
exit
->
killed
)
/* already exited!
(race condition) */
if
(
exit
->
killed
&&
handler
!=
NULL
)
/* already exited
(race condition) */
handler
(
opaque
);
exit
->
handler
=
handler
;
exit
->
opaque
=
opaque
;
...
...
@@ -61,8 +58,7 @@ void libvlc_SetExitHandler( libvlc_int_t *p_libvlc, void (*handler) (void *),
}
/**
* Posts an exit signal to LibVLC instance. This only emits a notification to
* the main thread. It might take a while before the actual cleanup occurs.
* Posts an exit signal to LibVLC instance.
* This function should only be called on behalf of the user.
*/
void
libvlc_Quit
(
libvlc_int_t
*
p_libvlc
)
...
...
@@ -79,32 +75,3 @@ void libvlc_Quit( libvlc_int_t *p_libvlc )
}
vlc_mutex_unlock
(
&
exit
->
lock
);
}
static
void
exit_wakeup
(
void
*
data
)
{
vlc_cond_signal
(
data
);
}
/**
* Waits until the LibVLC instance gets an exit signal.
* This normally occurs when the user "exits" an interface plugin. But it can
* also be triggered by the special vlc://quit item, the update checker, or
* the playlist engine.
*/
void
libvlc_InternalWait
(
libvlc_int_t
*
p_libvlc
)
{
vlc_exit_t
*
exit
=
&
libvlc_priv
(
p_libvlc
)
->
exit
;
vlc_cond_t
wait
;
vlc_cond_init
(
&
wait
);
vlc_mutex_lock
(
&
exit
->
lock
);
exit
->
handler
=
exit_wakeup
;
exit
->
opaque
=
&
wait
;
while
(
!
exit
->
killed
)
vlc_cond_wait
(
&
wait
,
&
exit
->
lock
);
vlc_mutex_unlock
(
&
exit
->
lock
);
vlc_cond_destroy
(
&
wait
);
}
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