summaryrefslogtreecommitdiffstats
path: root/sub/find_subfiles.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-01-04 01:27:06 +0100
committerwm4 <wm4@nowhere>2014-01-04 01:27:29 +0100
commit7041d8cd3735c3832cc2ce7ed62467c25c37f511 (patch)
tree2c088883095c7de541e2e82184938a667df22e62 /sub/find_subfiles.c
parent6a1b12158d903c09b7889820451b07dc73ee8576 (diff)
downloadmpv-7041d8cd3735c3832cc2ce7ed62467c25c37f511.tar.bz2
mpv-7041d8cd3735c3832cc2ce7ed62467c25c37f511.tar.xz
vo: dropping subtitle files on the VO window adds them as subtitle files
Note that we don't try to be clever about detecting the files as subtitles: we just check the file extension. We could go all the way and check the files by opening them with a demuxer, but that would probably do more bad than good.
Diffstat (limited to 'sub/find_subfiles.c')
-rw-r--r--sub/find_subfiles.c5
1 files changed, 5 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;