]> git.sesse.net Git - vlc/commitdiff
* Fix subtitle detection. utf8_stat returns 0 if file is present.
authorDerk-Jan Hartman <hartman@videolan.org>
Tue, 27 Feb 2007 20:57:56 +0000 (20:57 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Tue, 27 Feb 2007 20:57:56 +0000 (20:57 +0000)
  P.S. this bug was present for 3 months, without anyone noticing it. That's just BAD people.

src/input/subtitles.c

index b8dfc89290dc485d57815b437c580f0ee07a6593..8a10f3c1fd53c411dc60592183415528695a2614 100644 (file)
@@ -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;