mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-16 22:40:53 +08:00
misc/path_utils: rename bstr_strip_ext() to mp_strip_ext()
This commit is contained in:
committed by
Kacper Michajłow
parent
089c172dff
commit
9dbf5d681d
+1
-1
@@ -108,7 +108,7 @@ static bool open_source(struct timeline *tl, char *filename)
|
||||
// are renamed.
|
||||
|
||||
struct bstr cuefile =
|
||||
bstr_strip_ext(bstr0(mp_basename(tl->demuxer->filename)));
|
||||
mp_strip_ext(bstr0(mp_basename(tl->demuxer->filename)));
|
||||
|
||||
DIR *d = opendir(bstrdup0(ctx, dirname));
|
||||
if (!d)
|
||||
|
||||
+1
-1
@@ -300,7 +300,7 @@ done:
|
||||
|
||||
bstr mp_guess_lang_from_filename(bstr name, int *lang_start, enum track_flags *flags)
|
||||
{
|
||||
name = bstr_strip(bstr_strip_ext(name));
|
||||
name = bstr_strip(mp_strip_ext(name));
|
||||
|
||||
if (lang_start)
|
||||
*lang_start = -1;
|
||||
|
||||
+1
-1
@@ -110,7 +110,7 @@ static bstr split_ext(bstr path, bstr *root)
|
||||
return ext;
|
||||
}
|
||||
|
||||
bstr bstr_strip_ext(bstr path)
|
||||
bstr mp_strip_ext(bstr path)
|
||||
{
|
||||
bstr root = {0};
|
||||
split_ext(path, &root);
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
const char *mp_basename(const char *path);
|
||||
bstr mp_basename_bstr(bstr path);
|
||||
|
||||
bstr bstr_strip_ext(bstr path);
|
||||
bstr mp_strip_ext(bstr path);
|
||||
bstr mp_get_ext(bstr path);
|
||||
|
||||
/* Return struct bstr referencing directory part of path, or if that
|
||||
|
||||
+1
-1
@@ -536,7 +536,7 @@ static int mp_property_filename(void *ctx, struct m_property *prop,
|
||||
if (strcmp(ka->key, "no-ext") == 0) {
|
||||
action = ka->action;
|
||||
arg = ka->arg;
|
||||
f = bstrto0(filename, bstr_strip_ext(bstr0(f)));
|
||||
f = bstrto0(filename, mp_strip_ext(bstr0(f)));
|
||||
}
|
||||
}
|
||||
int r = m_property_strdup_ro(action, arg, f);
|
||||
|
||||
@@ -79,7 +79,7 @@ static void append_dir_external_files(struct mpv_global *global, struct MPOpts *
|
||||
struct bstr f_fbname = bstr0(mp_basename(fname));
|
||||
struct bstr f_fname = mp_iconv_to_utf8(log, f_fbname,
|
||||
"UTF-8-MAC", MP_NO_LATIN1_FALLBACK);
|
||||
struct bstr f_fname_noext = bstrdup(tmpmem, bstr_strip_ext(f_fname));
|
||||
struct bstr f_fname_noext = bstrdup(tmpmem, mp_strip_ext(f_fname));
|
||||
struct bstr f_fname_trim = bstr_strip(f_fname_noext);
|
||||
|
||||
if (f_fbname.start != f_fname.start)
|
||||
@@ -101,7 +101,7 @@ static void append_dir_external_files(struct mpv_global *global, struct MPOpts *
|
||||
struct bstr dename = mp_iconv_to_utf8(log, den,
|
||||
"UTF-8-MAC", MP_NO_LATIN1_FALLBACK);
|
||||
// retrieve various parts of the filename
|
||||
struct bstr tmp_fname_noext = bstrdup(tmpmem2, bstr_strip_ext(dename));
|
||||
struct bstr tmp_fname_noext = bstrdup(tmpmem2, mp_strip_ext(dename));
|
||||
struct bstr tmp_fname_ext = mp_get_ext(dename);
|
||||
struct bstr tmp_fname_trim = bstr_strip(tmp_fname_noext);
|
||||
|
||||
|
||||
+1
-1
@@ -988,7 +988,7 @@ int mp_add_external_file(struct MPContext *mpctx, char *filename,
|
||||
} else {
|
||||
bstr parent = {0};
|
||||
if (mpctx->filename)
|
||||
parent = bstr_strip_ext(bstr0(mp_basename(mpctx->filename)));
|
||||
parent = mp_strip_ext(bstr0(mp_basename(mpctx->filename)));
|
||||
bstr title = bstr0(mp_basename(disp_filename));
|
||||
bstr_eatstart(&title, parent);
|
||||
bstr_eatstart(&title, bstr0("."));
|
||||
|
||||
+1
-1
@@ -181,7 +181,7 @@ static char *create_fname(struct MPContext *mpctx, char *template,
|
||||
name = mp_url_unescape(res, name);
|
||||
|
||||
if (fmt == 'F')
|
||||
name = bstrto0(res, bstr_strip_ext(bstr0(name)));
|
||||
name = bstrto0(res, mp_strip_ext(bstr0(name)));
|
||||
append_filename(&res, name);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2156,7 +2156,7 @@ static void update_user_shader_opts(struct gl_video *p, const char *path,
|
||||
return;
|
||||
|
||||
const char *basename = mp_basename(path);
|
||||
struct bstr shadername = bstr_strip_ext(bstr0(basename));
|
||||
struct bstr shadername = mp_strip_ext(bstr0(basename));
|
||||
|
||||
for (int n = 0; p->opts.user_shader_opts[n * 2]; n++) {
|
||||
struct bstr key = bstr0(p->opts.user_shader_opts[n * 2 + 0]);
|
||||
|
||||
@@ -2493,7 +2493,7 @@ static void update_hook_opts(struct priv *p, char **opts, const char *shaderpath
|
||||
return;
|
||||
|
||||
const char *basename = mp_basename(shaderpath);
|
||||
struct bstr shadername = bstr_strip_ext(bstr0(basename));
|
||||
struct bstr shadername = mp_strip_ext(bstr0(basename));
|
||||
|
||||
for (int n = 0; opts[n * 2]; n++) {
|
||||
struct bstr k = bstr0(opts[n * 2 + 0]);
|
||||
|
||||
Reference in New Issue
Block a user