Function subparse::get_subtitle_format_by_ending [] [src]

pub fn get_subtitle_format_by_ending(ending: &str) -> Option<SubtitleFormat>

Returns the subtitle format by the file ending.

Calling the function with the full file path or simply a get_subtitle_format_by_ending(".srt") both work. Returns None if subtitle format could not be recognized.

Because the .sub file ending is ambiguous (both MicroDVD and VobSub use that ending) the function will return None in that case. Instead, use the content-aware get_subtitle_format to handle this case correctly.