summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-03-26 19:48:38 +0200
committerKevin Mitchell <kevmitch@gmail.com>2018-03-26 23:06:51 -0700
commitaf9c6c11339c685c217a8ed5a75bb10049a460c2 (patch)
tree900292460850cd5e55a2616bfb8fd7d77b9dee46 /sub
parentcdbd20581e7da8657c4b17784546f2af6c579d36 (diff)
downloadmpv-af9c6c11339c685c217a8ed5a75bb10049a460c2.tar.bz2
mpv-af9c6c11339c685c217a8ed5a75bb10049a460c2.tar.xz
lavc_conv: do not allow libavcodec to drop subtitles with broken UTF-8
libavcodec normally drops subtitle lines that fail a check for invalid UTF-8 (their check is slightly broken too, by the way). This was always annoying and inconvenient, but now there is a mechanism to prevent it from doing this. Requires newst libavcodec.
Diffstat (limited to 'sub')
-rw-r--r--sub/lavc_conv.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sub/lavc_conv.c b/sub/lavc_conv.c
index 06b975660f..75c127cc82 100644
--- a/sub/lavc_conv.c
+++ b/sub/lavc_conv.c
@@ -94,6 +94,7 @@ struct lavc_conv *lavc_conv_create(struct mp_log *log, const char *codec_name,
avctx->time_base = (AVRational) {1, 1000};
#if LIBAVCODEC_VERSION_MICRO >= 100
avctx->pkt_timebase = avctx->time_base;
+ avctx->sub_charenc_mode = FF_SUB_CHARENC_MODE_IGNORE;
#endif
priv->avctx = avctx;
priv->extradata = talloc_strndup(priv, avctx->subtitle_header,