- FILE *f;
- char *psz_path;
-
- asprintf( &psz_path, "%s%s", j < 0 ? f_dir : *subdirs, p_fixed_name );
- msg_Dbg( p_this, "autodetected subtitle: %s with priority %d", p_fixed_name, 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", p_fixed_name, i_prio );
- result[i_sub_count].priority = i_prio;
- result[i_sub_count].psz_fname = psz_path;
- result[i_sub_count].psz_ext = strdup(tmp_fname_ext);
- i_sub_count++;
- }
- else
- {
- msg_Dbg( p_this, "fopen failed" );
- if( psz_path ) free( psz_path );
- LocaleFree( psz_path );
- }