- FILE *f;
- char psz_path[strlen( psz_dir ) + strlen( psz_name ) + 1];
-
- sprintf( psz_path, "%s%s", psz_dir, psz_name );
- msg_Dbg( p_this,
- "autodetected subtitle: %s with priority %d",
- psz_path, i_prio );
- /* FIXME: a portable wrapper for stat() or access() would be more suited */
- if( ( f = utf8_fopen( psz_path, "rt" ) ) )
- {
- fclose( f );
- msg_Dbg( p_this,
- "autodetected subtitle: %s with priority %d",
- psz_path, i_prio );
- result[i_sub_count].priority = i_prio;
- result[i_sub_count].psz_fname = strdup( psz_path );
- result[i_sub_count].psz_ext = strdup(tmp_fname_ext);
- i_sub_count++;
- }
- else
- {
- msg_Dbg( p_this, "fopen failed" );
- }