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
commit5a3b54c78ce63d899f76dbb3db72e4894b40bd53 (patch)
tree50693d13eeefc4d683bdf5417f0861b0ef274a0c /player/external_files.c
parentAdding debian version 0.37.0-1. (diff)
downloadmpv-5a3b54c78ce63d899f76dbb3db72e4894b40bd53.tar.xz
mpv-5a3b54c78ce63d899f76dbb3db72e4894b40bd53.zip
Merging upstream version 0.38.0.
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,