diff options
author | wm4 <wm4@nowhere> | 2016-12-28 15:31:25 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-12-28 15:31:25 +0100 |
commit | 35716b53dbd63f4eeacffc989a705dbcd4ef9f41 (patch) | |
tree | e83a01209ea33b5989977da4e1f3b4f4515f6f82 | |
parent | 22a22322cb612e9cff6ae642668f86dd15314598 (diff) |
charset_conv: fix "auto" fallback with uchardet not compiled
Tried to open iconv with "auto" as source codepage, instead of using
the latin1 fallback. This also neutralizes the libavcodec dumbass
UTF-8 check, which discards subtitles not in UTF-8 and shows an
error message for ffmpeg CLI instead.
Fixes #3954.
-rw-r--r-- | misc/charset_conv.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/misc/charset_conv.c b/misc/charset_conv.c index 1758223f1a..b66b73907d 100644 --- a/misc/charset_conv.c +++ b/misc/charset_conv.c @@ -191,7 +191,7 @@ const char *mp_charset_guess(void *talloc_ctx, struct mp_log *log, bstr buf, return "utf-8"; } - const char *res = user_cp; + const char *res = NULL; if (strcasecmp(user_cp, "auto") == 0) { #if HAVE_UCHARDET res = mp_uchardet(talloc_ctx, log, buf); @@ -200,6 +200,8 @@ const char *mp_charset_guess(void *talloc_ctx, struct mp_log *log, bstr buf, mp_verbose(log, "Charset auto-detection failed.\n"); res = "UTF-8-BROKEN"; } + } else { + res = user_cp; } mp_verbose(log, "Using charset '%s'.\n", res); |