Commit c2766f8b authored by Laurent Aimar's avatar Laurent Aimar

Removed b_block parameter from input_Read.

It is unused and not correctly implemented (!b_block case).
parent 9c0d4a43
...@@ -524,8 +524,8 @@ VLC_EXPORT( int, input_Start, ( input_thread_t * ) ); ...@@ -524,8 +524,8 @@ VLC_EXPORT( int, input_Start, ( input_thread_t * ) );
VLC_EXPORT( void, input_Stop, ( input_thread_t *, bool b_abort ) ); VLC_EXPORT( void, input_Stop, ( input_thread_t *, bool b_abort ) );
#define input_Read(a,b,c) __input_Read(VLC_OBJECT(a),b, c) #define input_Read(a,b) __input_Read(VLC_OBJECT(a),b)
VLC_EXPORT( int, __input_Read, ( vlc_object_t *, input_item_t *, bool ) ); VLC_EXPORT( int, __input_Read, ( vlc_object_t *, input_item_t * ) );
VLC_EXPORT( int, input_vaControl,( input_thread_t *, int i_query, va_list ) ); VLC_EXPORT( int, input_vaControl,( input_thread_t *, int i_query, va_list ) );
......
...@@ -492,7 +492,7 @@ static void openDirectory( intf_thread_t *p_intf, bool pl, bool go ) ...@@ -492,7 +492,7 @@ static void openDirectory( intf_thread_t *p_intf, bool pl, bool go )
PLAYLIST_END, pl, pl_Unlocked ); PLAYLIST_END, pl, pl_Unlocked );
RecentsMRL::getInstance( p_intf )->addRecent( mrl ); RecentsMRL::getInstance( p_intf )->addRecent( mrl );
if( !go ) if( !go )
input_Read( THEPL, p_input, true ); input_Read( THEPL, p_input );
vlc_gc_decref( p_input ); vlc_gc_decref( p_input );
} }
} }
......
...@@ -207,7 +207,7 @@ static void *Run( void *data ) ...@@ -207,7 +207,7 @@ static void *Run( void *data )
vlc_event_attach( p_em, vlc_InputItemSubItemAdded, vlc_event_attach( p_em, vlc_InputItemSubItemAdded,
input_item_subitem_added, p_sd ); input_item_subitem_added, p_sd );
input_Read( p_sd, p_root, true ); input_Read( p_sd, p_root );
vlc_event_detach( p_em, vlc_InputItemSubItemAdded, vlc_event_detach( p_em, vlc_InputItemSubItemAdded,
input_item_subitem_added, p_sd ); input_item_subitem_added, p_sd );
......
...@@ -214,7 +214,7 @@ static void AddSubitemsOfShoutItemURL( services_discovery_t *p_sd, ...@@ -214,7 +214,7 @@ static void AddSubitemsOfShoutItemURL( services_discovery_t *p_sd,
/* Read every subitems, and add them in ItemAdded */ /* Read every subitems, and add them in ItemAdded */
vlc_event_attach( &p_input->event_manager, vlc_InputItemSubItemAdded, vlc_event_attach( &p_input->event_manager, vlc_InputItemSubItemAdded,
ItemAdded, &category ); ItemAdded, &category );
input_Read( p_sd, p_input, true ); input_Read( p_sd, p_input );
vlc_event_detach( &p_input->event_manager, vlc_InputItemSubItemAdded, vlc_event_detach( &p_input->event_manager, vlc_InputItemSubItemAdded,
ItemAdded, &category ); ItemAdded, &category );
......
...@@ -279,7 +279,7 @@ libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist, ...@@ -279,7 +279,7 @@ libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
if( libvlc_exception_raised( p_e ) ) if( libvlc_exception_raised( p_e ) )
return; return;
input_Read( p_mlist->p_libvlc_instance->p_libvlc_int, p_input_item, true ); input_Read( p_mlist->p_libvlc_instance->p_libvlc_int, p_input_item );
return; return;
} }
......
...@@ -156,16 +156,13 @@ input_thread_t *__input_CreateAndStart( vlc_object_t *p_parent, ...@@ -156,16 +156,13 @@ input_thread_t *__input_CreateAndStart( vlc_object_t *p_parent,
} }
/** /**
* Initialize an input thread and run it. This thread will clean after itself, * Initialize an input thread and run it until it stops by itself.
* you can forget about it. It can work either in blocking or non-blocking mode
* *
* \param p_parent a vlc_object * \param p_parent a vlc_object
* \param p_item an input item * \param p_item an input item
* \param b_block should we block until read is finished ?
* \return an error code, VLC_SUCCESS on success * \return an error code, VLC_SUCCESS on success
*/ */
int __input_Read( vlc_object_t *p_parent, input_item_t *p_item, int __input_Read( vlc_object_t *p_parent, input_item_t *p_item )
bool b_block )
{ {
input_thread_t *p_input; input_thread_t *p_input;
...@@ -173,23 +170,8 @@ int __input_Read( vlc_object_t *p_parent, input_item_t *p_item, ...@@ -173,23 +170,8 @@ 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;
if( b_block )
{
RunAndDestroy( VLC_OBJECT(p_input) ); RunAndDestroy( VLC_OBJECT(p_input) );
return VLC_SUCCESS; return VLC_SUCCESS;
}
else
{
if( vlc_thread_create( p_input, "input", RunAndDestroy,
VLC_THREAD_PRIORITY_INPUT ) )
{
input_ChangeState( p_input, ERROR_S );
msg_Err( p_input, "cannot create input thread" );
vlc_object_release( p_input );
return VLC_EGENERIC;
}
}
return VLC_SUCCESS;
} }
/** /**
......
...@@ -98,7 +98,7 @@ int playlist_Import( playlist_t *p_playlist, const char *psz_file ) ...@@ -98,7 +98,7 @@ int playlist_Import( playlist_t *p_playlist, const char *psz_file )
playlist_AddInput( p_playlist, p_input, PLAYLIST_APPEND, PLAYLIST_END, playlist_AddInput( p_playlist, p_input, PLAYLIST_APPEND, PLAYLIST_END,
true, false ); true, false );
return input_Read( p_playlist, p_input, true ); return input_Read( p_playlist, p_input );
} }
/***************************************************************************** /*****************************************************************************
...@@ -187,7 +187,7 @@ int playlist_MLLoad( playlist_t *p_playlist ) ...@@ -187,7 +187,7 @@ int playlist_MLLoad( playlist_t *p_playlist )
PL_UNLOCK; PL_UNLOCK;
stats_TimerStart( p_playlist, "ML Load", STATS_TIMER_ML_LOAD ); stats_TimerStart( p_playlist, "ML Load", STATS_TIMER_ML_LOAD );
input_Read( p_playlist, p_input, true ); input_Read( p_playlist, p_input );
stats_TimerStop( p_playlist,STATS_TIMER_ML_LOAD ); stats_TimerStop( p_playlist,STATS_TIMER_ML_LOAD );
PL_LOCK; PL_LOCK;
......
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