diff options
-rw-r--r-- | mpvcore/mplayer.c | 8 | ||||
-rw-r--r-- | sub/find_subfiles.c | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/mpvcore/mplayer.c b/mpvcore/mplayer.c index d811bd8207..ad1bae476b 100644 --- a/mpvcore/mplayer.c +++ b/mpvcore/mplayer.c @@ -3957,9 +3957,15 @@ static void open_subtitles_from_options(struct MPContext *mpctx) char **tmp = find_text_subtitles(mpctx->opts, mpctx->filename); int nsub = MP_TALLOC_ELEMS(tmp); for (int i = 0; i < nsub; i++) { - struct track *track = mp_add_subtitles(mpctx, tmp[i]); + char *filename = tmp[i]; + for (int n = 0; n < mpctx->num_sources; n++) { + if (strcmp(mpctx->sources[n]->stream->url, filename) == 0) + goto skip; + } + struct track *track = mp_add_subtitles(mpctx, filename); if (track) track->auto_loaded = true; + skip:; } talloc_free(tmp); } 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 |