[FFmpeg-devel] [PATCH] lavc: make invalid UTF-8 in subtitle output a non-fatal error
nfxjfg at googlemail.com
Wed Jun 26 01:20:34 CEST 2013
The intention of this error was preventing the generation of broken
files. But in practice, dropping the output is not very helpful.
Consider a subtitle file that contains mostly ASCII, but has some
lines that use special characters (like umlauts or accents) encoded
in a legacy codepage. Then most lines will be intact in the output
file, but lines with broken encoding will be missing. The user might
not even see the error, and it will appear as if the subtitle line
was missing in the original subtitle file. Surely it's better to
keep these broken lines, and most of the subtitle text will probably
still be readable.
Keeping the broken output will also make it easier for the user to
locate the error, such as by knowing the subtitle event time.
libavcodec/utils.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 97d066f..14a3b5f 100644
@@ -2288,8 +2288,6 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
"Invalid UTF-8 in decoded subtitles text; "
"maybe missing -sub_charenc option\n");
- return AVERROR_INVALIDDATA;
More information about the ffmpeg-devel