diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-10-29 01:32:44 +0100 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-10-29 01:32:44 +0100 |
commit | 19a6431ec247e4842236292cc5f8cfc8f87da11e (patch) | |
tree | 6b2dbcbc3533fec685d825e723b9d237dbfa79b0 /libavformat/subtitles.c | |
parent | 26122145559f55b6061281bd96a66cebdc5ac33f (diff) | |
download | ffmpeg-19a6431ec247e4842236292cc5f8cfc8f87da11e.tar.gz |
Print a warning if a subtitle demuxer changes utf16 to utf8.
This does not fix anything but gives users a chance to
know that they must not pass -sub_charenc UTF-16 to ffmpeg.
Fixes ticket #4059.
Diffstat (limited to 'libavformat/subtitles.c')
-rw-r--r-- | libavformat/subtitles.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/subtitles.c b/libavformat/subtitles.c index 95faca6e48..7f4bdef45e 100644 --- a/libavformat/subtitles.c +++ b/libavformat/subtitles.c @@ -24,7 +24,7 @@ #include "libavutil/avassert.h" #include "libavutil/avstring.h" -void ff_text_init_avio(FFTextReader *r, AVIOContext *pb) +void ff_text_init_avio(void *s, FFTextReader *r, AVIOContext *pb) { int i; r->pb = pb; @@ -45,13 +45,16 @@ void ff_text_init_avio(FFTextReader *r, AVIOContext *pb) r->buf_pos += 3; } } + if (s && (r->type == FF_UTF16LE || r->type == FF_UTF16BE)) + av_log(s, AV_LOG_WARNING, + "UTF16 is automatically converted to UTF8, do not specify a character encoding\n"); } void ff_text_init_buf(FFTextReader *r, void *buf, size_t size) { memset(&r->buf_pb, 0, sizeof(r->buf_pb)); ffio_init_context(&r->buf_pb, buf, size, 0, NULL, NULL, NULL, NULL); - ff_text_init_avio(r, &r->buf_pb); + ff_text_init_avio(NULL, r, &r->buf_pb); } int64_t ff_text_pos(FFTextReader *r) |