Commit 01d3be26 authored by Thomas Guillem's avatar Thomas Guillem

preparser: send a status code on PreparseEnded

parent dfa111dc
......@@ -188,6 +188,10 @@ typedef struct vlc_event_t
{
bool new_value;
} input_item_error_when_reading_changed;
struct input_item_preparse_ended
{
int new_status;
} input_item_preparse_ended;
/* Service discovery events */
struct vlc_services_discovery_item_added
......
......@@ -337,6 +337,14 @@ typedef enum input_item_meta_request_option_t
META_REQUEST_OPTION_DO_INTERACT = 0x04
} input_item_meta_request_option_t;
/* status of the vlc_InputItemPreparseEnded event */
enum input_item_preparse_status
{
ITEM_PREPARSE_SKIPPED,
ITEM_PREPARSE_FAILED,
ITEM_PREPARSE_DONE
};
VLC_API int libvlc_MetaRequest(libvlc_int_t *, input_item_t *,
input_item_meta_request_option_t );
VLC_API int libvlc_ArtRequest(libvlc_int_t *, input_item_t *,
......
......@@ -30,7 +30,7 @@
/**********************************************************************
* Item metadata
**********************************************************************/
void input_item_SignalPreparseEnded( input_item_t *p_i );
void input_item_SignalPreparseEnded( input_item_t *p_i, int new_status );
void input_item_SetPreparsed( input_item_t *p_i, bool b_preparsed );
void input_item_SetArtNotFound( input_item_t *p_i, bool b_not_found );
void input_item_SetArtFetched( input_item_t *p_i, bool b_art_fetched );
......
......@@ -64,10 +64,11 @@ void input_item_SetErrorWhenReading( input_item_t *p_i, bool b_error )
vlc_event_send( &p_i->event_manager, &event );
}
}
void input_item_SignalPreparseEnded( input_item_t *p_i )
void input_item_SignalPreparseEnded( input_item_t *p_i, int status )
{
vlc_event_t event;
event.type = vlc_InputItemPreparseEnded;
event.u.input_item_preparse_ended.new_status = status;
vlc_event_send( &p_i->event_manager, &event );
}
......
......@@ -187,7 +187,7 @@ static void Preparse( playlist_preparser_t *preparser, input_item_t *p_item,
p_item );
if( input == NULL )
{
input_item_SignalPreparseEnded( p_item );
input_item_SignalPreparseEnded( p_item, ITEM_PREPARSE_FAILED );
return;
}
......@@ -205,9 +205,11 @@ static void Preparse( playlist_preparser_t *preparser, input_item_t *p_item,
var_SetAddress( preparser->object, "item-change", p_item );
input_item_SetPreparsed( p_item, true );
input_item_SignalPreparseEnded( p_item, ITEM_PREPARSE_DONE );
}
else if (!b_preparse)
input_item_SignalPreparseEnded( p_item, ITEM_PREPARSE_SKIPPED );
input_item_SignalPreparseEnded( p_item );
}
/**
......
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