[vlc-devel] commit: input: Support file://localhost/file type url. (Pierre d'Herbemont )

git version control git at videolan.org
Tue Jun 30 02:12:03 CEST 2009


vlc | branch: 1.0-bugfix | Pierre d'Herbemont <pdherbemont at free.fr> | Sun Jun 28 20:18:17 2009 -0700| [27f49fef6ad6a07accdfd3e600072e65436e30aa] | committer: Derk-Jan Hartman 

input: Support file://localhost/file type url.
(cherry picked from commit 16f6bf947e9977eb540c599f462a66cd7d2a96a0)

Signed-off-by: Derk-Jan Hartman <hartman at videolan.org>

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

 src/input/input.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index c849ae5..b18914b 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2354,12 +2354,18 @@ static int InputSourceInit( input_thread_t *p_input,
             && psz_path[0] != DIR_SEP_CHAR
 #endif
           )
-        {   /* host specified -> not supported currently */
-            msg_Err( p_input, "cannot open remote file `%s://%s'",
-                     psz_access, psz_path );
-            msg_Info( p_input, "Did you mean `%s:///%s'?",
-                      psz_access, psz_path );
-            goto error;
+        {   /* host specified -> only localhost is supported */
+            static const unsigned localhostLen = 9; /* strlen("localhost") */
+            if (!strncmp( psz_path, "localhost" DIR_SEP, localhostLen + 1))
+                psz_path += localhostLen;
+            else
+            {
+                msg_Err( p_input, "cannot open remote file `%s://%s'",
+                        psz_access, psz_path );
+                msg_Info( p_input, "Did you mean `%s:///%s'?",
+                         psz_access, psz_path );
+                goto error;
+            }
         }
         /* Remove HTML anchor if present (not supported). */
         char *p = strchr( psz_path, '#' );




More information about the vlc-devel mailing list