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

input: inline input_CreateAndStart(), fix error handling

parent 192d8de5
......@@ -495,9 +495,6 @@ enum input_query_e
VLC_API input_thread_t * input_Create( vlc_object_t *p_parent, input_item_t *, const char *psz_log, input_resource_t * ) VLC_USED;
#define input_Create(a,b,c,d) input_Create(VLC_OBJECT(a),b,c,d)
VLC_API input_thread_t * input_CreateAndStart( vlc_object_t *p_parent, input_item_t *, const char *psz_log ) VLC_USED;
#define input_CreateAndStart(a,b,c) input_CreateAndStart(VLC_OBJECT(a),b,c)
VLC_API int input_Start( input_thread_t * );
VLC_API void input_Stop( input_thread_t * );
......@@ -511,6 +508,27 @@ VLC_API int input_Control( input_thread_t *, int i_query, ... );
VLC_API void input_Close( input_thread_t * );
/**
* Create a new input_thread_t and start it.
*
* Provided for convenience.
*
* \see input_Create
*/
static inline
input_thread_t *input_CreateAndStart( vlc_object_t *parent,
input_item_t *item, const char *log )
{
input_thread_t *input = input_Create( parent, item, log, NULL );
if( input != NULL && input_Start( input ) )
{
vlc_object_release( input );
input = NULL;
}
return input;
}
#define input_CreateAndStart(a,b,c) input_CreateAndStart(VLC_OBJECT(a),b,c)
/**
* Get the input item for an input thread
*
......
......@@ -129,27 +129,6 @@ input_thread_t *input_Create( vlc_object_t *p_parent,
return Create( p_parent, p_item, psz_log, false, p_resource );
}
#undef input_CreateAndStart
/**
* Create a new input_thread_t and start it.
*
* Provided for convenience.
*
* \see input_Create
*/
input_thread_t *input_CreateAndStart( vlc_object_t *p_parent,
input_item_t *p_item, const char *psz_log )
{
input_thread_t *p_input = input_Create( p_parent, p_item, psz_log, NULL );
if( input_Start( p_input ) )
{
vlc_object_release( p_input );
return NULL;
}
return p_input;
}
#undef input_Read
/**
* Initialize an input thread and run it until it stops by itself.
......
......@@ -173,7 +173,6 @@ image_Type2Fourcc
InitMD5
input_Control
input_Create
input_CreateAndStart
input_CreateFilename
input_DecoderCreate
input_DecoderDelete
......
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