VLC 4.0.0-dev
|
This file contains functions to detect subtitle files. More...
Functions | |
static void | filename_strip_ext_inplace (char *str) |
Remove file extension in-place. More... | |
static char * | filename_trim_inplace (char *str) |
Trim special characters from a filename. More... | |
static int | whiteonly (const char *s) |
static int | slave_strcmp (const void *a, const void *b) |
int | subtitles_Filter (const char *psz_dir_content) |
static char ** | paths_to_list (const char *psz_dir, char *psz_path) |
Convert a list of paths separated by ',' to a char**. More... | |
int | subtitles_Detect (input_thread_t *p_this, char *psz_path, const char *psz_name_org, input_item_slave_t ***ppp_slaves, int *p_slaves) |
Detect subtitle files. More... | |
Variables | |
static const char *const | sub_exts [] = { "aqt", "ass", "cdg", "dks", "idx", "jss", "mpl2", "mpsub", "pjs", "psb", "rt", "sami", "sbv", "scc", "smi", "srt", "ssa", "stl", "sub", "tt", "ttml", "usf", "vtt", "webvtt" , "" } |
The possible extensions for subtitle files we support. More... | |
This file contains functions to detect subtitle files.
|
static |
Remove file extension in-place.
Referenced by subtitles_Detect().
|
static |
Trim special characters from a filename.
Trims whitespaces and other non-alphanumeric characters from filenames.
Referenced by subtitles_Detect().
|
static |
Convert a list of paths separated by ',' to a char**.
References asprintf().
Referenced by subtitles_Detect().
|
static |
References input_item_slave::psz_uri, and strcoll.
Referenced by subtitles_Detect().
int subtitles_Detect | ( | input_thread_t * | p_this, |
char * | psz_path, | ||
const char * | psz_name_org, | ||
input_item_slave_t *** | ppp_slaves, | ||
int * | p_slaves | ||
) |
Detect subtitle files.
When called this function will split up the psz_name string into a directory, filename and extension. It then opens the directory in which the file resides and tries to find possible matches of subtitles files.
p_this | the calling input_thread_t |
psz_path | a list of subdirectories (separated by a ',') to look in. |
psz_name_org | the complete filename to base the search on. |
pp_slaves | an initialized input item slave list to append detected subtitles to |
p_slaves | pointer to the size of the slave list |
References asprintf(), input_item_slave::b_forced, DIR_SEP, DIR_SEP_CHAR, filename_strip_ext_inplace(), filename_trim_inplace(), input_item_slave::i_priority, input_item_slave_Delete, input_item_slave_New(), msg_Dbg, paths_to_list(), psz_ext, psz_name, input_item_slave::psz_uri, SLAVE_PRIORITY_MATCH_ALL, SLAVE_PRIORITY_MATCH_LEFT, SLAVE_PRIORITY_MATCH_NONE, SLAVE_PRIORITY_MATCH_RIGHT, slave_strcmp(), SLAVE_TYPE_SPU, strcasecmp(), strdup(), subtitles_Filter(), TAB_APPEND, var_GetInteger(), vlc_closedir(), VLC_EGENERIC, VLC_ENOMEM, vlc_opendir(), vlc_path2uri(), vlc_readdir(), vlc_stat(), VLC_SUCCESS, vlc_uri2path(), and whiteonly().
Referenced by LoadSlaves().
int subtitles_Filter | ( | const char * | psz_dir_content | ) |
References strcasecmp(), and sub_exts.
Referenced by subtitles_Detect(), and vlc_player_AddAssociatedMedia().
|
static |
Referenced by subtitles_Detect().
|
static |
The possible extensions for subtitle files we support.
Referenced by subtitles_Filter().