* This file contains functions to dectect subtitle files.
*/
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
#include <vlc_input.h>
#include <vlc_charset.h>
# include <dirent.h>
#endif
-#ifdef HAVE_LIMITS_H
-# include <limits.h>
-#endif
+#include <limits.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
}
if( !f_fname || !f_dir )
{
- FREE( f_fname );
- FREE( f_dir );
+ free( f_fname );
+ free( f_dir );
return NULL;
}
f_fname_trim = malloc(i_fname_len + 1 );
if( !f_fname_noext || !f_fname_trim )
{
- FREE( f_fname );
- FREE( f_dir );
- FREE( f_fname_noext );
- FREE( f_fname_trim );
+ free( f_fname );
+ free( f_dir );
+ free( f_fname_noext );
+ free( f_fname_trim );
return NULL;
}
if( ppsz_dir_content )
{
for( a = 0; a < i_dir_content; a++ )
- FREE( ppsz_dir_content[a] );
+ free( ppsz_dir_content[a] );
free( ppsz_dir_content );
}
}
if( subdirs )
{
for( j = 0; subdirs[j]; j++ )
- FREE( subdirs[j] );
+ free( subdirs[j] );
free( subdirs );
}
free( f_fname );
for( j = 0, i_result2 = 0; j < i_sub_count && result2 != NULL; j++ )
{
- vlc_bool_t b_reject = VLC_FALSE;
+ bool b_reject = false;
if( !result[j].psz_fname || !result[j].psz_ext ) /* memory out */
break;
break;
}
if( i < i_sub_count )
- b_reject = VLC_TRUE;
+ b_reject = true;
}
else if( !strcasecmp( result[j].psz_ext, "cdg" ) )
{
if( result[j].priority < SUB_PRIORITY_MATCH_ALL )
- b_reject = VLC_TRUE;
+ b_reject = true;
}
/* */
for( j = 0; j < i_sub_count; j++ )
{
- FREE( result[j].psz_fname );
- FREE( result[j].psz_ext );
+ free( result[j].psz_fname );
+ free( result[j].psz_ext );
}
free( result );