]> git.sesse.net Git - vlc/blobdiff - src/input/subtitles.c
Remove useless detach before destroy
[vlc] / src / input / subtitles.c
index 01aeda54fc4b0cfe5deb65ae85f893213ed07d4a..2ca105ff08618b16702eea71c662e485639ebcd2 100644 (file)
@@ -32,7 +32,7 @@
 #endif
 
 #include <vlc_common.h>
-#include <vlc_charset.h>
+#include <vlc_fs.h>
 #include <vlc_url.h>
 
 #ifdef HAVE_DIRENT_H
@@ -262,13 +262,7 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
     if( !psz_name_org )
         return NULL;
 
-    if( !strncmp( psz_name_org, "file://", 7 ) )
-    {
-        psz_name_org += 7;
-        if( !strncmp( psz_name_org, "localhost", 9 ) )
-            psz_name_org += 9;
-    }
-    char *psz_fname = decode_URI_duplicate( psz_name_org );
+    char *psz_fname = make_path( psz_name_org );
     if( !psz_fname )
         return NULL;
 
@@ -338,7 +332,7 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
             continue;
 
         /* parse psz_src dir */
-        i_dir_content = utf8_scandir( psz_dir, &ppsz_dir_content,
+        i_dir_content = vlc_scandir( psz_dir, &ppsz_dir_content,
                                       subtitles_Filter, NULL );
         if( i_dir_content < 0 )
             continue;
@@ -399,7 +393,7 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
                 if( !strcmp( psz_path, psz_fname ) )
                     continue;
 
-                if( !utf8_stat( psz_path, &st ) && S_ISREG( st.st_mode ) && result )
+                if( !vlc_stat( psz_path, &st ) && S_ISREG( st.st_mode ) && result )
                 {
                     msg_Dbg( p_this,
                             "autodetected subtitle: %s with priority %d",