Commit 8af8cab6 authored by Thomas Guillem's avatar Thomas Guillem
Browse files

preparser: handle input errors

And don't timeout in case of error.
parent cecb49ed
...@@ -76,7 +76,8 @@ static int PreparserOpenInput( void* preparser_, void* item_, void** out ) ...@@ -76,7 +76,8 @@ static int PreparserOpenInput( void* preparser_, void* item_, void** out )
static int PreparserProbeInput( void* preparser_, void* input_ ) static int PreparserProbeInput( void* preparser_, void* input_ )
{ {
return input_GetState( input_ ) == END_S; int state = input_GetState( input_ );
return state == END_S || state == ERROR_S;
VLC_UNUSED( preparser_ ); VLC_UNUSED( preparser_ );
} }
...@@ -88,8 +89,18 @@ static void PreparserCloseInput( void* preparser_, void* input_ ) ...@@ -88,8 +89,18 @@ static void PreparserCloseInput( void* preparser_, void* input_ )
var_DelCallback( input, "intf-event", InputEvent, preparser->worker ); var_DelCallback( input, "intf-event", InputEvent, preparser->worker );
int status = input_GetState( input ) == END_S int status;
? ITEM_PREPARSE_DONE : ITEM_PREPARSE_TIMEOUT; switch( input_GetState( input ) )
{
case END_S:
status = ITEM_PREPARSE_DONE;
break;
case ERROR_S:
status = ITEM_PREPARSE_FAILED;
break;
default:
status = ITEM_PREPARSE_TIMEOUT;
}
input_Stop( input ); input_Stop( input );
input_Close( input ); input_Close( input );
......
Supports Markdown
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