]> git.sesse.net Git - vlc/commitdiff
Ticket 3234 autodetect subtitles
authorKamil Baldyga <kbaldyga@gmail.com>
Sat, 30 Jan 2010 20:01:08 +0000 (21:01 +0100)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 31 Jan 2010 15:50:24 +0000 (17:50 +0200)
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
src/input/subtitles.c

index 01aeda54fc4b0cfe5deb65ae85f893213ed07d4a..2b8f31af956fd8dba6b23edbed731d8b322df213 100644 (file)
@@ -265,9 +265,18 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
     if( !strncmp( psz_name_org, "file://", 7 ) )
     {
         psz_name_org += 7;
+#if defined( WIN32 )
+        psz_name_org ++ ;
+#endif
         if( !strncmp( psz_name_org, "localhost", 9 ) )
             psz_name_org += 9;
     }
+
+#if (DIR_SEP_CHAR != '/')
+        /* Turn slashes into anti-slashes */
+        for( char *s = strchr( psz_name_org, '/' ); s; s = strchr( s + 1, '/' ) )
+            *s = DIR_SEP_CHAR;
+#endif
     char *psz_fname = decode_URI_duplicate( psz_name_org );
     if( !psz_fname )
         return NULL;