[vlc-commits] Used input_Close() where applicable.
Laurent Aimar
git at videolan.org
Sun May 22 22:41:04 CEST 2011
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun May 22 21:49:58 2011 +0200| [67b16b1b9f1babba51ca186a5a1107156f897c09] | committer: Laurent Aimar
Used input_Close() where applicable.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=67b16b1b9f1babba51ca186a5a1107156f897c09
---
modules/services_discovery/podcast.c | 6 ++----
src/control/media_player.c | 9 ++-------
src/input/vlm.c | 11 +++--------
src/playlist/thread.c | 3 +--
4 files changed, 8 insertions(+), 21 deletions(-)
diff --git a/modules/services_discovery/podcast.c b/modules/services_discovery/podcast.c
index 1b00a2b..74c4a01 100644
--- a/modules/services_discovery/podcast.c
+++ b/modules/services_discovery/podcast.c
@@ -184,8 +184,7 @@ static void Close( vlc_object_t *p_this )
continue;
input_Stop( p_input, true );
- vlc_thread_join( p_input );
- vlc_object_release( p_input );
+ input_Close( p_input );
p_sd->p_sys->pp_input[i] = NULL;
}
@@ -236,8 +235,7 @@ static void *Run( void *data )
if( p_input->b_eof || p_input->b_error )
{
input_Stop( p_input, false );
- vlc_thread_join( p_input );
- vlc_object_release( p_input );
+ input_Close( p_input );
p_sd->p_sys->pp_input[i] = NULL;
REMOVE_ELEM( p_sys->pp_input, p_sys->i_input, i );
diff --git a/src/control/media_player.c b/src/control/media_player.c
index 701154c..9a644dd 100644
--- a/src/control/media_player.c
+++ b/src/control/media_player.c
@@ -129,6 +129,7 @@ static void release_input_thread( libvlc_media_player_t *p_mi, bool b_input_abor
input_thread_t *p_input_thread = p_mi->input.p_thread;
if( !p_input_thread )
return;
+ p_mi->input.p_thread = NULL;
var_DelCallback( p_input_thread, "can-seek",
input_seekable_changed, p_mi );
@@ -139,13 +140,7 @@ static void release_input_thread( libvlc_media_player_t *p_mi, bool b_input_abor
/* We owned this one */
input_Stop( p_input_thread, b_input_abort );
-
- vlc_thread_join( p_input_thread );
-
- assert( p_input_thread->b_dead );
-
- p_mi->input.p_thread = NULL;
- vlc_object_release( p_input_thread );
+ input_Close( p_input_thread );
}
/*
diff --git a/src/input/vlm.c b/src/input/vlm.c
index 92f0d47..977d84f 100644
--- a/src/input/vlm.c
+++ b/src/input/vlm.c
@@ -673,8 +673,7 @@ static int vlm_OnMediaUpdate( vlm_t *p_vlm, vlm_media_sys_t *p_media )
&preparse );
input_Stop( p_input, true );
- vlc_thread_join( p_input );
- vlc_object_release( p_input );
+ input_Close( p_input );
vlc_sem_destroy( &sem_preparse );
}
free( psz_header );
@@ -916,10 +915,8 @@ static void vlm_MediaInstanceDelete( vlm_t *p_vlm, int64_t id, vlm_media_instanc
if( p_input )
{
input_Stop( p_input, true );
- vlc_thread_join( p_input );
-
var_DelCallback( p_instance->p_input, "intf-event", InputEvent, p_media );
- vlc_object_release( p_input );
+ input_Close( p_input );
vlm_SendEventMediaInstanceStopped( p_vlm, id, p_media->cfg.psz_name );
}
@@ -1012,10 +1009,8 @@ static int vlm_ControlMediaInstanceStart( vlm_t *p_vlm, int64_t id, const char *
input_Stop( p_input, true );
- vlc_thread_join( p_input );
-
var_DelCallback( p_instance->p_input, "intf-event", InputEvent, p_media );
- vlc_object_release( p_input );
+ input_Close( p_input );
if( !p_instance->b_sout_keep )
input_resource_TerminateSout( p_instance->p_input_resource );
diff --git a/src/playlist/thread.c b/src/playlist/thread.c
index d0b2a9f..992d082 100644
--- a/src/playlist/thread.c
+++ b/src/playlist/thread.c
@@ -481,8 +481,7 @@ static int LoopInput( playlist_t *p_playlist )
PL_LOCK;
p_sys->p_input = NULL;
- vlc_thread_join( p_input );
- vlc_object_release( p_input );
+ input_Close( p_input );
UpdateActivity( p_playlist, -DEFAULT_INPUT_ACTIVITY );
More information about the vlc-commits
mailing list