[vlc-devel] commit: vlm: Remove the callback before joining the thread, and save a dead lock. (Pierre d'Herbemont )
git version control
git at videolan.org
Thu Feb 11 20:35:50 CET 2010
vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Thu Feb 11 20:34:30 2010 +0100| [f4bc3b96d4062f2518ef55848115504f468c3f1f] | committer: Pierre d'Herbemont
vlm: Remove the callback before joining the thread, and save a dead lock.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f4bc3b96d4062f2518ef55848115504f468c3f1f
---
src/input/vlm.c | 16 ++++------------
1 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/src/input/vlm.c b/src/input/vlm.c
index 96197a1..5b61be5 100644
--- a/src/input/vlm.c
+++ b/src/input/vlm.c
@@ -105,16 +105,6 @@ static int InputEvent( vlc_object_t *p_this, char const *psz_cmd,
}
vlm_SendEventMediaInstanceState( p_vlm, p_media->cfg.id, p_media->cfg.psz_name, psz_instance_name, var_GetInteger( p_input, "state" ) );
- // We have ourselves been triggering the stop event.
- // No need to wake up our manage thread, because
- // we'll join it just after the Stop().
- vlc_mutex_lock( &p_input->p->lock_control );
- bool abort = p_input->p->b_abort;
- vlc_mutex_unlock( &p_input->p->lock_control );
-
- if (abort)
- return VLC_SUCCESS;
-
vlc_mutex_lock( &p_vlm->lock );
vlc_cond_signal( &p_vlm->wait );
vlc_mutex_unlock( &p_vlm->lock );
@@ -860,13 +850,14 @@ static void vlm_MediaInstanceDelete( vlm_t *p_vlm, int64_t id, vlm_media_instanc
{
input_resource_t *p_resource;
+ var_DelCallback( p_instance->p_input, "intf-event", InputEvent, p_media );
+
input_Stop( p_input, true );
vlc_thread_join( p_input );
p_resource = input_DetachResource( p_input );
input_resource_Delete( p_resource );
- var_DelCallback( p_instance->p_input, "intf-event", InputEvent, p_media );
vlc_object_release( p_input );
vlm_SendEventMediaInstanceStopped( p_vlm, id, p_media->cfg.psz_name );
@@ -945,12 +936,13 @@ static int vlm_ControlMediaInstanceStart( vlm_t *p_vlm, int64_t id, const char *
return VLC_SUCCESS;
}
+ var_DelCallback( p_instance->p_input, "intf-event", InputEvent, p_media );
+
input_Stop( p_input, true );
vlc_thread_join( p_input );
p_instance->p_input_resource = input_DetachResource( p_input );
- var_DelCallback( p_instance->p_input, "intf-event", InputEvent, p_media );
vlc_object_release( p_input );
if( !p_instance->b_sout_keep )
More information about the vlc-devel
mailing list