From 819515d6fbe7c7869600f8d9782fc66799c282d7 Mon Sep 17 00:00:00 2001 From: henry Date: Tue, 8 Apr 2003 20:41:20 +0000 Subject: [PATCH] turn most of the subtitle matching fuzziness off by default git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9885 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/en/mplayer.1 | 4 ++++ cfg-common.h | 1 + subreader.c | 4 +++- subreader.h | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/DOCS/en/mplayer.1 b/DOCS/en/mplayer.1 index 5ca66eb46d..bfb1c76a06 100644 --- a/DOCS/en/mplayer.1 +++ b/DOCS/en/mplayer.1 @@ -1081,6 +1081,10 @@ Tells MPlayer to handle the subtitle file as UTF8. Disables any kind of text post processing done after loading the subtitles. Used for debug purposes. .TP +.B \-subfuzzy +Relax when trying to find matching subtitles. Loads all subtitles in +the current directory, allowing to select the right ones during playing. +.TP .B \-vobsub Specify the VobSub files that are to be used for subtitle. This is the full pathname without extensions, i.e.\& without the '.idx', diff --git a/cfg-common.h b/cfg-common.h index 8d87504c1e..78e9a9c0dc 100644 --- a/cfg-common.h +++ b/cfg-common.h @@ -212,6 +212,7 @@ {"sub-bg-color", &sub_bg_color, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL}, {"sub-bg-alpha", &sub_bg_alpha, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL}, {"sub-no-text-pp", &sub_no_text_pp, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"subfuzzy", &subfuzzy_enabled, CONF_TYPE_FLAG, 0, 0, 1, NULL}, #endif #ifdef USE_OSD {"font", &font_name, CONF_TYPE_STRING, 0, 0, 0, NULL}, diff --git a/subreader.c b/subreader.c index 9f6b99590a..6127546ee4 100644 --- a/subreader.c +++ b/subreader.c @@ -40,6 +40,8 @@ static int sub_slacktime = 20000; //20 sec int sub_no_text_pp=0; // 1 => do not apply text post-processing // like {\...} elimination in SSA format. +int subfuzzy_enabled=0; // be _really_ fuzzy when looking for subtitles + /* Use the SUB_* constant defined in the header file */ int sub_format=SUB_INVALID; #ifdef USE_SORTSUB @@ -1696,7 +1698,7 @@ char** sub_filenames(char* path, char *fname) } else { // doesn't contain the movie name // don't try in the mplayer subtitle directory - if (j == 0) { + if ((j == 0) && subfuzzy_enabled) { sprintf(tmpresult, "%s%s", f_dir, de->d_name); if ((f = fopen(tmpresult, "rt"))) { fclose(f); diff --git a/subreader.h b/subreader.h index d1c9a82c24..361e4aa317 100644 --- a/subreader.h +++ b/subreader.h @@ -3,6 +3,7 @@ extern int suboverlap_enabled; extern int sub_no_text_pp; // disable text post-processing +extern int subfuzzy_enabled; // subtitle formats #define SUB_INVALID -1