[vlc-devel] [PATCH] preparser: handle input errors
Thomas Guillem
thomas at gllm.fr
Thu Jun 1 11:13:15 CEST 2017
And don't timeout in case of error.
---
src/playlist/preparser.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/playlist/preparser.c b/src/playlist/preparser.c
index 04ba92d4fc..1122dd7cef 100644
--- a/src/playlist/preparser.c
+++ b/src/playlist/preparser.c
@@ -76,7 +76,8 @@ static int PreparserOpenInput( void* preparser_, void* item_, void** out )
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_ );
}
@@ -88,8 +89,18 @@ static void PreparserCloseInput( void* preparser_, void* input_ )
var_DelCallback( input, "intf-event", InputEvent, preparser->worker );
- int status = input_GetState( input ) == END_S
- ? ITEM_PREPARSE_DONE : ITEM_PREPARSE_TIMEOUT;
+ int status;
+ 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_Close( input );
--
2.11.0
More information about the vlc-devel
mailing list