summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-07-27 08:38:12 +0300
committerUoti Urpala <uau@mplayer2.org>2011-07-27 08:38:12 +0300
commit0958620591375b41a8d21dd2a3501e1c9e5e9cba (patch)
treebbfcf29330c7408cd1991f3a81138c9bbba81419 /sub
parentea4cc89f36e064b3224d633df8bc08cc49178d51 (diff)
downloadmpv-0958620591375b41a8d21dd2a3501e1c9e5e9cba.tar.bz2
mpv-0958620591375b41a8d21dd2a3501e1c9e5e9cba.tar.xz
bstr: rename BSTR() -> bstr()
Rename the BSTR() function to bstr(). The former caused a conflict with some Windows OS name, and it's no longer a macro so uppercase naming is less appropriate.
Diffstat (limited to 'sub')
-rw-r--r--sub/find_subfiles.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/sub/find_subfiles.c b/sub/find_subfiles.c
index 1e4b33d0cc..3de8014ce1 100644
--- a/sub/find_subfiles.c
+++ b/sub/find_subfiles.c
@@ -89,7 +89,7 @@ static void append_dir_subtitles(struct MPOpts *opts,
FILE *f;
assert(strlen(fname) < 1e6);
- struct bstr f_fname = BSTR(mp_basename(fname));
+ struct bstr f_fname = bstr(mp_basename(fname));
struct bstr f_fname_noext = bstrdup(tmpmem, strip_ext(f_fname));
bstr_lower(f_fname_noext);
struct bstr f_fname_trim = bstr_strip(f_fname_noext);
@@ -105,7 +105,7 @@ static void append_dir_subtitles(struct MPOpts *opts,
mp_msg(MSGT_SUBREADER, MSGL_INFO, "Load subtitles in %.*s\n", BSTR_P(path));
struct dirent *de;
while ((de = readdir(d))) {
- struct bstr dename = BSTR(de->d_name);
+ struct bstr dename = bstr(de->d_name);
void *tmpmem2 = talloc_new(tmpmem);
// retrieve various parts of the filename
@@ -116,11 +116,11 @@ static void append_dir_subtitles(struct MPOpts *opts,
// If it's a .sub, check if there is a .idx with the same name. If
// there is one, it's certainly a vobsub so we skip it.
- if (bstrcasecmp(tmp_fname_ext, BSTR("sub")) == 0) {
+ if (bstrcasecmp(tmp_fname_ext, bstr("sub")) == 0) {
char *idxname = talloc_asprintf(tmpmem2, "%.*s.idx",
(int)tmp_fname_noext.len,
de->d_name);
- char *idx = mp_path_join(tmpmem2, path, BSTR(idxname));
+ char *idx = mp_path_join(tmpmem2, path, bstr(idxname));
f = fopen(idx, "rt");
if (f) {
fclose(f);
@@ -141,7 +141,7 @@ static void append_dir_subtitles(struct MPOpts *opts,
while (1) {
if (!sub_exts[i])
goto next_sub;
- if (bstrcasecmp(BSTR(sub_exts[i]), tmp_fname_ext) == 0)
+ if (bstrcasecmp(bstr(sub_exts[i]), tmp_fname_ext) == 0)
break;
i++;
}
@@ -154,7 +154,7 @@ static void append_dir_subtitles(struct MPOpts *opts,
if (lang.len) {
for (int n = 0; opts->sub_lang[n]; n++) {
if (bstr_startswith(lang,
- BSTR(opts->sub_lang[n]))) {
+ bstr(opts->sub_lang[n]))) {
prio = 4; // matches the movie name + lang extension
break;
}
@@ -217,15 +217,15 @@ char **find_text_subtitles(struct MPOpts *opts, const char *fname)
if (opts->sub_paths) {
for (int i = 0; opts->sub_paths[i]; i++) {
char *path = mp_path_join(slist, mp_dirname(fname),
- BSTR(opts->sub_paths[i]));
- append_dir_subtitles(opts, &slist, &n, BSTR(path), fname, 0);
+ bstr(opts->sub_paths[i]));
+ append_dir_subtitles(opts, &slist, &n, bstr(path), fname, 0);
}
}
// Load subtitles in ~/.mplayer/sub limiting sub fuzziness
char *mp_subdir = get_path("sub/");
if (mp_subdir)
- append_dir_subtitles(opts, &slist, &n, BSTR(mp_subdir), fname, 1);
+ append_dir_subtitles(opts, &slist, &n, bstr(mp_subdir), fname, 1);
free(mp_subdir);
// Sort subs by priority and append them
@@ -245,7 +245,7 @@ char **find_vob_subtitles(struct MPOpts *opts, const char *fname)
int n = 0;
// Potential vobsub in the media directory
- struct bstr bname = BSTR(mp_basename(fname));
+ struct bstr bname = bstr(mp_basename(fname));
int pdot = bstrrchr(bname, '.');
if (pdot >= 0)
bname.len = pdot;
@@ -255,9 +255,9 @@ char **find_vob_subtitles(struct MPOpts *opts, const char *fname)
if (opts->sub_paths) {
for (int i = 0; opts->sub_paths[i]; i++) {
char *path = mp_path_join(NULL, mp_dirname(fname),
- BSTR(opts->sub_paths[i]));
+ bstr(opts->sub_paths[i]));
MP_GROW_ARRAY(vobs, n);
- vobs[n++] = mp_path_join(vobs, BSTR(path), bname);
+ vobs[n++] = mp_path_join(vobs, bstr(path), bname);
talloc_free(path);
}
}
@@ -266,7 +266,7 @@ char **find_vob_subtitles(struct MPOpts *opts, const char *fname)
char *mp_subdir = get_path("sub/");
if (mp_subdir) {
MP_GROW_ARRAY(vobs, n);
- vobs[n++] = mp_path_join(vobs, BSTR(mp_subdir), bname);
+ vobs[n++] = mp_path_join(vobs, bstr(mp_subdir), bname);
}
free(mp_subdir);