1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-04 05:07:51 +00:00

charset_conv: fallback to interpreting subs as latin1 if iconv fails

For display purposes, it's better to show scrambled text - at least
that's a more actionable failure mode than spamming the terminal with
FFmpeg nonsense error messages.

This avoids the obnoxious and pointless

  "Invalid UTF-8 in decoded subtitles text; maybe missing -sub_charenc option"

FFmpeg error, which will be spammed on every single subtitle event. We
don't even have a -sub-charenc option, fuck FFmpeg.

Did I mention fuck FFmpeg yet? Because fuck FFmpeg.
This commit is contained in:
wm4 2017-01-22 13:10:16 +01:00
parent 310671e91a
commit 06c55ac6c3

View File

@ -234,5 +234,5 @@ bstr mp_iconv_to_utf8(struct mp_log *log, bstr buf, const char *cp, int flags)
#endif #endif
failure: failure:
return (bstr){0}; return bstr_sanitize_utf8_latin1(NULL, buf);
} }