[vlc-commits] preparser: handle input errors

Thomas Guillem git at videolan.org
Thu Jun 1 14:22:04 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Jun  1 11:12:52 2017 +0200| [8af8cab6134e7fafe5ae09b699c0039da879d01d] | committer: Thomas Guillem

preparser: handle input errors

And don't timeout in case of error.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8af8cab6134e7fafe5ae09b699c0039da879d01d
---

 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 );



More information about the vlc-commits mailing list