Commit da316c39 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

libvlc_wait: wait until libvlc is killed by an interface

parent 8b270041
...@@ -157,6 +157,15 @@ VLC_PUBLIC_API ...@@ -157,6 +157,15 @@ VLC_PUBLIC_API
void libvlc_run_interface( libvlc_instance_t *p_instance, const char *name, void libvlc_run_interface( libvlc_instance_t *p_instance, const char *name,
libvlc_exception_t *p_exception ); libvlc_exception_t *p_exception );
/**
* Waits until an interface causes the instance to exit.
* You should start at least one interface first, using libvlc_add_intf().
*
* \param p_instance the instance
*/
VLC_PUBLIC_API
void libvlc_wait( libvlc_instance_t *p_instance );
/** /**
* Retrieve libvlc version. * Retrieve libvlc version.
* *
......
...@@ -173,6 +173,14 @@ void libvlc_run_interface( libvlc_instance_t *p_i, const char *name, ...@@ -173,6 +173,14 @@ void libvlc_run_interface( libvlc_instance_t *p_i, const char *name,
RAISEVOID( "Interface initialization failed" ); RAISEVOID( "Interface initialization failed" );
} }
void libvlc_wait( libvlc_instance_t *p_i )
{
libvlc_int_t *p_libvlc = p_i->p_libvlc_int;
vlc_object_lock( p_libvlc );
while( !vlc_object_wait( p_libvlc ) );
vlc_object_unlock( p_libvlc );
}
int libvlc_get_vlc_id( libvlc_instance_t *p_instance ) int libvlc_get_vlc_id( libvlc_instance_t *p_instance )
{ {
return p_instance->p_libvlc_int->i_object_id; return p_instance->p_libvlc_int->i_object_id;
......
...@@ -203,6 +203,7 @@ libvlc_vlm_set_loop ...@@ -203,6 +203,7 @@ libvlc_vlm_set_loop
libvlc_vlm_set_output libvlc_vlm_set_output
libvlc_vlm_show_media libvlc_vlm_show_media
libvlc_vlm_stop_media libvlc_vlm_stop_media
libvlc_wait
mediacontrol_RGBPicture__free mediacontrol_RGBPicture__free
mediacontrol_StreamInformation__free mediacontrol_StreamInformation__free
mediacontrol_display_text mediacontrol_display_text
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment