summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
Diffstat (limited to 'sub')
-rw-r--r--sub/find_subfiles.c5
-rw-r--r--sub/find_subfiles.h4
2 files changed, 9 insertions, 0 deletions
diff --git a/sub/find_subfiles.c b/sub/find_subfiles.c
index e5577c3912..5efbd20476 100644
--- a/sub/find_subfiles.c
+++ b/sub/find_subfiles.c
@@ -42,6 +42,11 @@ static struct bstr get_ext(struct bstr s)
return bstr_splice(s, dotpos + 1, s.len);
}
+bool mp_might_be_subtitle_file(const char *filename)
+{
+ return is_sub_ext(get_ext(bstr0(filename)));
+}
+
static int compare_sub_filename(const void *a, const void *b)
{
const struct subfn *s1 = a;
diff --git a/sub/find_subfiles.h b/sub/find_subfiles.h
index d11c02627b..85b491f1f9 100644
--- a/sub/find_subfiles.h
+++ b/sub/find_subfiles.h
@@ -19,6 +19,8 @@
#ifndef MPLAYER_FIND_SUBFILES_H
#define MPLAYER_FIND_SUBFILES_H
+#include <stdbool.h>
+
struct subfn {
int priority;
char *fname;
@@ -28,4 +30,6 @@ struct subfn {
struct mpv_global;
struct subfn *find_text_subtitles(struct mpv_global *global, const char *fname);
+bool mp_might_be_subtitle_file(const char *filename);
+
#endif /* MPLAYER_FINDFILES_H */