summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-09-07 20:33:47 +0200
committerwm4 <wm4@nowhere>2013-09-07 20:34:49 +0200
commitc7ab8ea513fdc15a500dddcae01fa76cd07d0d84 (patch)
treed49535f34f43026017c133dc6290b08962c13826 /sub
parentdc475728e0fd395e0780a2e41b0dc19af162e383 (diff)
downloadmpv-c7ab8ea513fdc15a500dddcae01fa76cd07d0d84.tar.bz2
mpv-c7ab8ea513fdc15a500dddcae01fa76cd07d0d84.tar.xz
mplayer: don't auto-load explicitly loaded subtitle files
Even if a subtitle was explicitly loaded with -sub, it was still auto- loaded (if auto-loading applied to that file). Fix this by explicitly checking whether a file is already loaded. The check is maximal naive and just compares the filenames as strings. The change in find_subfiles.c is so that "-sub something.ass" happens to work (auto-loading prepended a "./" to it, so the naive filename comparison check didn't work).
Diffstat (limited to 'sub')
-rw-r--r--sub/find_subfiles.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sub/find_subfiles.c b/sub/find_subfiles.c
index e81dca964a..f272e84e73 100644
--- a/sub/find_subfiles.c
+++ b/sub/find_subfiles.c
@@ -172,6 +172,10 @@ static void append_dir_subtitles(struct MPOpts *opts,
MP_GROW_ARRAY(*slist, *nsub);
struct subfn *sub = *slist + (*nsub)++;
+ // annoying and redundant
+ if (strncmp(subpath, "./", 2) == 0)
+ subpath += 2;
+
sub->priority = prio;
sub->fname = subpath;
} else