summaryrefslogtreecommitdiffstats
path: root/player/external_files.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
commit60e8a3d404f0640fa5a3f834eae54b4f1fb9127d (patch)
tree1da89a218d0ecf010c67a87cb2f625c4cb18e7d7 /player/external_files.c
parentAdding upstream version 0.37.0. (diff)
downloadmpv-60e8a3d404f0640fa5a3f834eae54b4f1fb9127d.tar.xz
mpv-60e8a3d404f0640fa5a3f834eae54b4f1fb9127d.zip
Adding upstream version 0.38.0.upstream/0.38.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'player/external_files.c')
-rw-r--r--player/external_files.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/player/external_files.c b/player/external_files.c
index e9a6081..2e00912 100644
--- a/player/external_files.c
+++ b/player/external_files.c
@@ -142,6 +142,14 @@ static struct bstr guess_lang_from_filename(struct bstr name, int *fn_start)
return (struct bstr){name.start + i + 1, n};
}
+char *mp_guess_lang_from_filename(void* ctx, const char *filename)
+{
+ bstr filename_no_ext = bstr_strip_ext(bstr0(filename));
+ int start = 0; // only used in append_dir_subtitles()
+ char *lang = bstrto0(ctx, guess_lang_from_filename(filename_no_ext, &start));
+ return lang;
+}
+
static void append_dir_subtitles(struct mpv_global *global, struct MPOpts *opts,
struct subfn **slist, int *nsub,
struct bstr path, const char *fname,