]> git.sesse.net Git - vlc/blobdiff - src/input/subtitles.c
* subtitles.c: case insensitive search for subtitle file extensions.
[vlc] / src / input / subtitles.c
index b8dfc89290dc485d57815b437c580f0ee07a6593..dbd54788693eab608ae23733446f4f8dbbe8ea33 100644 (file)
@@ -165,7 +165,7 @@ int subtitles_Filter( const char *psz_dir_content )
         tmp++;
 
         for( i = 0; sub_exts[i]; i++ )
-            if( strcmp( sub_exts[i], tmp ) == 0 )
+            if( strcasecmp( sub_exts[i], tmp ) == 0 )
                 return 1;
     }
     return 0;
@@ -400,7 +400,7 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
                                 "autodetected subtitle: %s with priority %d",
                                 psz_path, i_prio );
 
-                    if( utf8_stat( psz_path, &st ) && S_ISREG( st.st_mode ) )
+                    if( !utf8_stat( psz_path, &st ) && S_ISREG( st.st_mode ) )
                     {
                         msg_Dbg( p_this,
                                 "autodetected subtitle: %s with priority %d",
@@ -412,7 +412,7 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
                     }
                     else
                     {
-                        msg_Dbg( p_this, "fopen failed" );
+                        msg_Dbg( p_this, "stat failed" );
                     }
                 }
                 if( i_sub_count >= MAX_SUBTITLE_FILES ) break;