Commit 600e2cd5 authored by Laurent Aimar's avatar Laurent Aimar

Changed input_DestroyThread to take care of detaching, cleaning and destroying input.

(This way it matches input_CreateThread and fixes a memleak)
Control variables are now created even for preparse, only callback are not added.
(This fix use of uninitialized variables)
parent 9886e26b
...@@ -200,8 +200,6 @@ static void Close( vlc_object_t *p_this ) ...@@ -200,8 +200,6 @@ static void Close( vlc_object_t *p_this )
{ {
input_StopThread( p_sd->p_sys->pp_input[i] ); input_StopThread( p_sd->p_sys->pp_input[i] );
input_DestroyThread( p_sd->p_sys->pp_input[i] ); input_DestroyThread( p_sd->p_sys->pp_input[i] );
vlc_object_detach( p_sd->p_sys->pp_input[i] );
vlc_object_destroy( p_sd->p_sys->pp_input[i] );
p_sd->p_sys->pp_input[i] = NULL; p_sd->p_sys->pp_input[i] = NULL;
} }
} }
...@@ -233,8 +231,6 @@ static void Run( services_discovery_t *p_sd ) ...@@ -233,8 +231,6 @@ static void Run( services_discovery_t *p_sd )
{ {
input_StopThread( p_sd->p_sys->pp_input[i] ); input_StopThread( p_sd->p_sys->pp_input[i] );
input_DestroyThread( p_sd->p_sys->pp_input[i] ); input_DestroyThread( p_sd->p_sys->pp_input[i] );
vlc_object_detach( p_sd->p_sys->pp_input[i] );
vlc_object_destroy( p_sd->p_sys->pp_input[i] );
p_sd->p_sys->pp_input[i] = NULL; p_sd->p_sys->pp_input[i] = NULL;
} }
} }
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
static int Run ( input_thread_t *p_input ); static int Run ( input_thread_t *p_input );
static int RunAndClean ( input_thread_t *p_input ); static int RunAndDestroy ( input_thread_t *p_input );
static input_thread_t * Create ( vlc_object_t *, input_item_t *, static input_thread_t * Create ( vlc_object_t *, input_item_t *,
const char *, vlc_bool_t ); const char *, vlc_bool_t );
...@@ -197,8 +197,7 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item, ...@@ -197,8 +197,7 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
input_ConfigVarInit( p_input ); input_ConfigVarInit( p_input );
/* Create Objects variables for public Get and Set */ /* Create Objects variables for public Get and Set */
if( !p_input->b_preparsing ) input_ControlVarInit( p_input );
input_ControlVarInit( p_input );
p_input->p->input.i_cr_average = var_GetInteger( p_input, "cr-average" ); p_input->p->input.i_cr_average = var_GetInteger( p_input, "cr-average" );
...@@ -254,9 +253,25 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item, ...@@ -254,9 +253,25 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
input_Control( p_input, INPUT_DEL_INFO, _(VLC_META_INFO_CAT), input_Control( p_input, INPUT_DEL_INFO, _(VLC_META_INFO_CAT),
VLC_META_NOW_PLAYING ); /* ? Don't translate as it might has been copied ? */ VLC_META_NOW_PLAYING ); /* ? Don't translate as it might has been copied ? */
/* */
if( p_input->b_preparsing )
p_input->i_flags |= OBJECT_FLAGS_QUIET | OBJECT_FLAGS_NOINTERACT;
/* Attach only once we are ready */
vlc_object_attach( p_input, p_parent );
return p_input; return p_input;
} }
static void Destroy( input_thread_t *p_input )
{
vlc_object_detach( p_input );
vlc_mutex_destroy( &p_input->p->lock_control );
free( p_input->p );
vlc_object_destroy( p_input );
}
/** /**
* Initialize an input thread and run it. You will need to monitor the * Initialize an input thread and run it. You will need to monitor the
* thread to clean up after it is done * thread to clean up after it is done
...@@ -282,18 +297,13 @@ input_thread_t *__input_CreateThread2( vlc_object_t *p_parent, ...@@ -282,18 +297,13 @@ input_thread_t *__input_CreateThread2( vlc_object_t *p_parent,
if( !p_input ) if( !p_input )
return NULL; return NULL;
/* Now we can attach our new input */
vlc_object_attach( p_input, p_parent );
/* Create thread and wait for its readiness. */ /* Create thread and wait for its readiness. */
if( vlc_thread_create( p_input, "input", Run, if( vlc_thread_create( p_input, "input", Run,
VLC_THREAD_PRIORITY_INPUT, VLC_TRUE ) ) VLC_THREAD_PRIORITY_INPUT, VLC_TRUE ) )
{ {
input_ChangeState( p_input, ERROR_S ); input_ChangeState( p_input, ERROR_S );
msg_Err( p_input, "cannot create input thread" ); msg_Err( p_input, "cannot create input thread" );
vlc_object_detach( p_input ); Destroy( p_input );
free( p_input->p );
vlc_object_destroy( p_input );
return NULL; return NULL;
} }
...@@ -318,24 +328,19 @@ int __input_Read( vlc_object_t *p_parent, input_item_t *p_item, ...@@ -318,24 +328,19 @@ int __input_Read( vlc_object_t *p_parent, input_item_t *p_item,
if( !p_input ) if( !p_input )
return VLC_EGENERIC; return VLC_EGENERIC;
/* Now we can attach our new input */
vlc_object_attach( p_input, p_parent );
if( b_block ) if( b_block )
{ {
RunAndClean( p_input ); RunAndDestroy( p_input );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
else else
{ {
if( vlc_thread_create( p_input, "input", RunAndClean, if( vlc_thread_create( p_input, "input", RunAndDestroy,
VLC_THREAD_PRIORITY_INPUT, VLC_TRUE ) ) VLC_THREAD_PRIORITY_INPUT, VLC_TRUE ) )
{ {
input_ChangeState( p_input, ERROR_S ); input_ChangeState( p_input, ERROR_S );
msg_Err( p_input, "cannot create input thread" ); msg_Err( p_input, "cannot create input thread" );
vlc_object_detach( p_input ); Destroy( p_input );
free( p_input->p );
vlc_object_destroy( p_input );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
} }
...@@ -359,23 +364,17 @@ int __input_Preparse( vlc_object_t *p_parent, input_item_t *p_item ) ...@@ -359,23 +364,17 @@ int __input_Preparse( vlc_object_t *p_parent, input_item_t *p_item )
if( !p_input ) if( !p_input )
return VLC_EGENERIC; return VLC_EGENERIC;
p_input->i_flags |= OBJECT_FLAGS_QUIET;
p_input->i_flags |= OBJECT_FLAGS_NOINTERACT;
/* Now we can attach our new input */
vlc_object_attach( p_input, p_parent );
Init( p_input ); Init( p_input );
/* Clean up master */ /* Clean up master */
InputSourceClean( p_input, &p_input->p->input ); InputSourceClean( p_input, &p_input->p->input );
/* FIXME shouldn't we call End() to ? */
/* Unload all modules */ /* Unload all modules */
if( p_input->p->p_es_out ) input_EsOutDelete( p_input->p->p_es_out ); if( p_input->p->p_es_out ) input_EsOutDelete( p_input->p->p_es_out );
vlc_object_detach( p_input ); Destroy( p_input );
free( p_input->p );
vlc_object_destroy( p_input );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -434,11 +433,8 @@ void input_DestroyThread( input_thread_t *p_input ) ...@@ -434,11 +433,8 @@ void input_DestroyThread( input_thread_t *p_input )
/* Join the thread */ /* Join the thread */
vlc_thread_join( p_input ); vlc_thread_join( p_input );
/* Delete input lock (only after thread joined) */ /* */
vlc_mutex_destroy( &p_input->p->lock_control ); Destroy( p_input );
/* TODO: maybe input_DestroyThread should also delete p_input instead
* of the playlist but I'm not sure if it's possible */
} }
/***************************************************************************** /*****************************************************************************
...@@ -498,20 +494,17 @@ static int Run( input_thread_t *p_input ) ...@@ -498,20 +494,17 @@ static int Run( input_thread_t *p_input )
} }
/***************************************************************************** /*****************************************************************************
* RunAndClean: main thread loop * RunAndDestroy: main thread loop
* This is the "just forget me" thread that spawns the input processing chain, * This is the "just forget me" thread that spawns the input processing chain,
* reads the stream, cleans up and releases memory * reads the stream, cleans up and releases memory
*****************************************************************************/ *****************************************************************************/
static int RunAndClean( input_thread_t *p_input ) static int RunAndDestroy( input_thread_t *p_input )
{ {
/* Signal that the thread is launched */ /* Signal that the thread is launched */
vlc_thread_ready( p_input ); vlc_thread_ready( p_input );
if( Init( p_input ) ) if( Init( p_input ) )
{ goto exit;
/* If we failed, just exit */
return 0;
}
MainLoop( p_input ); MainLoop( p_input );
...@@ -535,11 +528,9 @@ static int RunAndClean( input_thread_t *p_input ) ...@@ -535,11 +528,9 @@ static int RunAndClean( input_thread_t *p_input )
/* Clean up */ /* Clean up */
End( p_input ); End( p_input );
exit:
/* Release memory */ /* Release memory */
vlc_object_detach( p_input ); Destroy( p_input );
free( p_input->p );
vlc_object_destroy( p_input );
return 0; return 0;
} }
...@@ -1143,14 +1134,11 @@ static void End( input_thread_t * p_input ) ...@@ -1143,14 +1134,11 @@ static void End( input_thread_t * p_input )
{ {
int i; int i;
msg_Dbg( p_input, "closing input" );
/* We are at the end */ /* We are at the end */
input_ChangeState( p_input, END_S ); input_ChangeState( p_input, END_S );
/* Clean control variables */ /* Clean control variables */
if( !p_input->b_preparsing ) input_ControlVarClean( p_input );
input_ControlVarClean( p_input );
/* Clean up master */ /* Clean up master */
InputSourceClean( p_input, &p_input->p->input ); InputSourceClean( p_input, &p_input->p->input );
......
...@@ -75,46 +75,49 @@ void input_ControlVarInit ( input_thread_t *p_input ) ...@@ -75,46 +75,49 @@ void input_ControlVarInit ( input_thread_t *p_input )
{ {
vlc_value_t val, text; vlc_value_t val, text;
/* XXX we put callback only in non preparsing mode. We need to create the variable
* unless someone want to check all var_Get/var_Change return value ... */
#define ADD_CALLBACK( name, callback ) do { if( !p_input->b_preparsing ) { var_AddCallback( p_input, name, callback, NULL ); } } while(0)
/* State */ /* State */
var_Create( p_input, "state", VLC_VAR_INTEGER ); var_Create( p_input, "state", VLC_VAR_INTEGER );
val.i_int = p_input->i_state; val.i_int = p_input->i_state;
var_Change( p_input, "state", VLC_VAR_SETVALUE, &val, NULL ); var_Change( p_input, "state", VLC_VAR_SETVALUE, &val, NULL );
var_AddCallback( p_input, "state", StateCallback, NULL ); ADD_CALLBACK( "state", StateCallback );
/* Rate */ /* Rate */
var_Create( p_input, "rate", VLC_VAR_INTEGER ); var_Create( p_input, "rate", VLC_VAR_INTEGER );
val.i_int = p_input->p->i_rate; val.i_int = p_input->p->i_rate;
var_Change( p_input, "rate", VLC_VAR_SETVALUE, &val, NULL ); var_Change( p_input, "rate", VLC_VAR_SETVALUE, &val, NULL );
var_AddCallback( p_input, "rate", RateCallback, NULL ); ADD_CALLBACK( "rate", RateCallback );
var_Create( p_input, "rate-slower", VLC_VAR_VOID ); var_Create( p_input, "rate-slower", VLC_VAR_VOID );
var_AddCallback( p_input, "rate-slower", RateCallback, NULL ); ADD_CALLBACK( "rate-slower", RateCallback );
var_Create( p_input, "rate-faster", VLC_VAR_VOID ); var_Create( p_input, "rate-faster", VLC_VAR_VOID );
var_AddCallback( p_input, "rate-faster", RateCallback, NULL ); ADD_CALLBACK( "rate-faster", RateCallback );
/* Position */ /* Position */
var_Create( p_input, "position", VLC_VAR_FLOAT ); var_Create( p_input, "position", VLC_VAR_FLOAT );
var_Create( p_input, "position-offset", VLC_VAR_FLOAT ); var_Create( p_input, "position-offset", VLC_VAR_FLOAT );
val.f_float = 0.0; val.f_float = 0.0;
var_Change( p_input, "position", VLC_VAR_SETVALUE, &val, NULL ); var_Change( p_input, "position", VLC_VAR_SETVALUE, &val, NULL );
var_AddCallback( p_input, "position", PositionCallback, NULL ); ADD_CALLBACK( "position", PositionCallback );
var_AddCallback( p_input, "position-offset", PositionCallback, NULL ); ADD_CALLBACK( "position-offset", PositionCallback );
/* Time */ /* Time */
var_Create( p_input, "time", VLC_VAR_TIME ); var_Create( p_input, "time", VLC_VAR_TIME );
var_Create( p_input, "time-offset", VLC_VAR_TIME ); /* relative */ var_Create( p_input, "time-offset", VLC_VAR_TIME ); /* relative */
val.i_time = 0; val.i_time = 0;
var_Change( p_input, "time", VLC_VAR_SETVALUE, &val, NULL ); var_Change( p_input, "time", VLC_VAR_SETVALUE, &val, NULL );
var_AddCallback( p_input, "time", TimeCallback, NULL ); ADD_CALLBACK( "time", TimeCallback );
var_AddCallback( p_input, "time-offset", TimeCallback, NULL ); ADD_CALLBACK( "time-offset", TimeCallback );
/* Bookmark */ /* Bookmark */
var_Create( p_input, "bookmark", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE | var_Create( p_input, "bookmark", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE |
VLC_VAR_ISCOMMAND ); VLC_VAR_ISCOMMAND );
val.psz_string = _("Bookmark"); val.psz_string = _("Bookmark");
var_Change( p_input, "bookmark", VLC_VAR_SETTEXT, &val, NULL ); var_Change( p_input, "bookmark", VLC_VAR_SETTEXT, &val, NULL );
var_AddCallback( p_input, "bookmark", BookmarkCallback, NULL ); ADD_CALLBACK( "bookmark", BookmarkCallback );
/* Program */ /* Program */
var_Create( p_input, "program", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE | var_Create( p_input, "program", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE |
...@@ -124,7 +127,7 @@ void input_ControlVarInit ( input_thread_t *p_input ) ...@@ -124,7 +127,7 @@ void input_ControlVarInit ( input_thread_t *p_input )
var_Change( p_input, "program", VLC_VAR_DELCHOICE, &val, NULL ); var_Change( p_input, "program", VLC_VAR_DELCHOICE, &val, NULL );
text.psz_string = _("Program"); text.psz_string = _("Program");
var_Change( p_input, "program", VLC_VAR_SETTEXT, &text, NULL ); var_Change( p_input, "program", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_input, "program", ProgramCallback, NULL ); ADD_CALLBACK( "program", ProgramCallback );
/* Programs */ /* Programs */
var_Create( p_input, "programs", VLC_VAR_LIST | VLC_VAR_DOINHERIT ); var_Create( p_input, "programs", VLC_VAR_LIST | VLC_VAR_DOINHERIT );
...@@ -135,13 +138,13 @@ void input_ControlVarInit ( input_thread_t *p_input ) ...@@ -135,13 +138,13 @@ void input_ControlVarInit ( input_thread_t *p_input )
var_Create( p_input, "title", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE ); var_Create( p_input, "title", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
text.psz_string = _("Title"); text.psz_string = _("Title");
var_Change( p_input, "title", VLC_VAR_SETTEXT, &text, NULL ); var_Change( p_input, "title", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_input, "title", TitleCallback, NULL ); ADD_CALLBACK( "title", TitleCallback );
/* Chapter */ /* Chapter */
var_Create( p_input, "chapter", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE ); var_Create( p_input, "chapter", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
text.psz_string = _("Chapter"); text.psz_string = _("Chapter");
var_Change( p_input, "chapter", VLC_VAR_SETTEXT, &text, NULL ); var_Change( p_input, "chapter", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_input, "chapter", SeekpointCallback, NULL ); ADD_CALLBACK( "chapter", SeekpointCallback );
/* Navigation The callback is added after */ /* Navigation The callback is added after */
var_Create( p_input, "navigation", VLC_VAR_VARIABLE | VLC_VAR_HASCHOICE ); var_Create( p_input, "navigation", VLC_VAR_VARIABLE | VLC_VAR_HASCHOICE );
...@@ -152,29 +155,29 @@ void input_ControlVarInit ( input_thread_t *p_input ) ...@@ -152,29 +155,29 @@ void input_ControlVarInit ( input_thread_t *p_input )
var_Create( p_input, "audio-delay", VLC_VAR_TIME ); var_Create( p_input, "audio-delay", VLC_VAR_TIME );
val.i_time = 0; val.i_time = 0;
var_Change( p_input, "audio-delay", VLC_VAR_SETVALUE, &val, NULL ); var_Change( p_input, "audio-delay", VLC_VAR_SETVALUE, &val, NULL );
var_AddCallback( p_input, "audio-delay", EsDelayCallback, NULL ); ADD_CALLBACK( "audio-delay", EsDelayCallback );
var_Create( p_input, "spu-delay", VLC_VAR_TIME ); var_Create( p_input, "spu-delay", VLC_VAR_TIME );
val.i_time = 0; val.i_time = 0;
var_Change( p_input, "spu-delay", VLC_VAR_SETVALUE, &val, NULL ); var_Change( p_input, "spu-delay", VLC_VAR_SETVALUE, &val, NULL );
var_AddCallback( p_input, "spu-delay", EsDelayCallback, NULL ); ADD_CALLBACK( "spu-delay", EsDelayCallback );
/* Video ES */ /* Video ES */
var_Create( p_input, "video-es", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE ); var_Create( p_input, "video-es", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
text.psz_string = _("Video Track"); text.psz_string = _("Video Track");
var_Change( p_input, "video-es", VLC_VAR_SETTEXT, &text, NULL ); var_Change( p_input, "video-es", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_input, "video-es", ESCallback, NULL ); ADD_CALLBACK( "video-es", ESCallback );
/* Audio ES */ /* Audio ES */
var_Create( p_input, "audio-es", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE ); var_Create( p_input, "audio-es", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
text.psz_string = _("Audio Track"); text.psz_string = _("Audio Track");
var_Change( p_input, "audio-es", VLC_VAR_SETTEXT, &text, NULL ); var_Change( p_input, "audio-es", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_input, "audio-es", ESCallback, NULL ); ADD_CALLBACK( "audio-es", ESCallback );
/* Spu ES */ /* Spu ES */
var_Create( p_input, "spu-es", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE ); var_Create( p_input, "spu-es", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
text.psz_string = _("Subtitles Track"); text.psz_string = _("Subtitles Track");
var_Change( p_input, "spu-es", VLC_VAR_SETTEXT, &text, NULL ); var_Change( p_input, "spu-es", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_input, "spu-es", ESCallback, NULL ); ADD_CALLBACK( "spu-es", ESCallback );
/* Special read only objects variables for intf */ /* Special read only objects variables for intf */
var_Create( p_input, "bookmarks", VLC_VAR_STRING | VLC_VAR_DOINHERIT ); var_Create( p_input, "bookmarks", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
...@@ -183,14 +186,18 @@ void input_ControlVarInit ( input_thread_t *p_input ) ...@@ -183,14 +186,18 @@ void input_ControlVarInit ( input_thread_t *p_input )
val.i_time = 0; val.i_time = 0;
var_Change( p_input, "length", VLC_VAR_SETVALUE, &val, NULL ); var_Change( p_input, "length", VLC_VAR_SETVALUE, &val, NULL );
/* Special "intf-change" variable, it allows intf to set up a callback if( !p_input->b_preparsing )
* to be notified of some changes. {
* TODO list all changes warn by this callbacks */ /* Special "intf-change" variable, it allows intf to set up a callback
var_Create( p_input, "intf-change", VLC_VAR_BOOL ); * to be notified of some changes.
var_SetBool( p_input, "intf-change", VLC_TRUE ); * TODO list all changes warn by this callbacks */
var_Create( p_input, "intf-change", VLC_VAR_BOOL );
/* item-change variable */ var_SetBool( p_input, "intf-change", VLC_TRUE );
var_Create( p_input, "item-change", VLC_VAR_INTEGER );
/* item-change variable */
var_Create( p_input, "item-change", VLC_VAR_INTEGER );
}
#undef ADD_CALLBACK
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -1147,8 +1147,6 @@ int vlm_MediaSetup( vlm_t *vlm, vlm_media_t *media, const char *psz_cmd, ...@@ -1147,8 +1147,6 @@ int vlm_MediaSetup( vlm_t *vlm, vlm_media_t *media, const char *psz_cmd,
input_StopThread( p_input ); input_StopThread( p_input );
input_DestroyThread( p_input ); input_DestroyThread( p_input );
vlc_object_detach( p_input );
vlc_object_destroy( p_input );
} }
free( psz_output ); free( psz_output );
free( psz_header ); free( psz_header );
...@@ -1241,8 +1239,6 @@ int vlm_MediaControl( vlm_t *vlm, vlm_media_t *media, const char *psz_id, ...@@ -1241,8 +1239,6 @@ int vlm_MediaControl( vlm_t *vlm, vlm_media_t *media, const char *psz_id,
{ {
input_StopThread( p_instance->p_input ); input_StopThread( p_instance->p_input );
input_DestroyThread( p_instance->p_input ); input_DestroyThread( p_instance->p_input );
vlc_object_detach( p_instance->p_input );
vlc_object_destroy( p_instance->p_input );
} }
asprintf( &psz_header, _("Media: %s"), media->psz_name ); asprintf( &psz_header, _("Media: %s"), media->psz_name );
...@@ -1362,8 +1358,6 @@ int vlm_MediaControl( vlm_t *vlm, vlm_media_t *media, const char *psz_id, ...@@ -1362,8 +1358,6 @@ int vlm_MediaControl( vlm_t *vlm, vlm_media_t *media, const char *psz_id,
{ {
input_StopThread( p_instance->p_input ); input_StopThread( p_instance->p_input );
input_DestroyThread( p_instance->p_input ); input_DestroyThread( p_instance->p_input );
vlc_object_detach( p_instance->p_input );
vlc_object_destroy( p_instance->p_input );
} }
input_ItemClean( &p_instance->item ); input_ItemClean( &p_instance->item );
...@@ -2497,8 +2491,6 @@ static int Manage( vlc_object_t* p_object ) ...@@ -2497,8 +2491,6 @@ static int Manage( vlc_object_t* p_object )
input_StopThread( p_instance->p_input ); input_StopThread( p_instance->p_input );
input_DestroyThread( p_instance->p_input ); input_DestroyThread( p_instance->p_input );
vlc_object_detach( p_instance->p_input );
vlc_object_destroy( p_instance->p_input );
p_instance->i_index++; p_instance->i_index++;
if( p_instance->i_index == p_media->i_input && if( p_instance->i_index == p_media->i_input &&
......
...@@ -259,13 +259,6 @@ check_input: ...@@ -259,13 +259,6 @@ check_input:
/* Destroy input */ /* Destroy input */
input_DestroyThread( p_input ); input_DestroyThread( p_input );
/* Unlink current input
* (_after_ input_DestroyThread for vout garbage collector) */
vlc_object_detach( p_input );
/* Destroy object */
vlc_object_destroy( p_input );
PL_LOCK; PL_LOCK;
p_playlist->gc_date = mdate(); p_playlist->gc_date = mdate();
...@@ -389,12 +382,6 @@ void playlist_LastLoop( playlist_t *p_playlist ) ...@@ -389,12 +382,6 @@ void playlist_LastLoop( playlist_t *p_playlist )
/* Destroy input */ /* Destroy input */
input_DestroyThread( p_input ); input_DestroyThread( p_input );
/* Unlink current input (_after_ input_DestroyThread for vout
* garbage collector)*/
vlc_object_detach( p_input );
/* Destroy object */
vlc_object_destroy( p_input );
continue; continue;
} }
else if( p_playlist->p_input->b_die ) else if( p_playlist->p_input->b_die )
......
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