diff options
author | jstebbins <[email protected]> | 2014-08-06 17:38:05 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2014-08-06 17:38:05 +0000 |
commit | 2879d30b9c81e78605264a7824fd86939397b369 (patch) | |
tree | 821d710842361a02b81bc8e6c4f08769810c20b7 /contrib | |
parent | 58d1681bcb286d99790887877e6dfa20f191dcf3 (diff) |
libav: fix mp4 chapter character encoding
The encoding was not being flagged as UTF8
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6271 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/ffmpeg/A04-mp4-chap-char-encoding.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/contrib/ffmpeg/A04-mp4-chap-char-encoding.patch b/contrib/ffmpeg/A04-mp4-chap-char-encoding.patch new file mode 100644 index 000000000..1cb8482d7 --- /dev/null +++ b/contrib/ffmpeg/A04-mp4-chap-char-encoding.patch @@ -0,0 +1,37 @@ +From bfdfd6c70e717c0ef8a89327931e8905f95eba7c Mon Sep 17 00:00:00 2001 +From: John Stebbins <[email protected]> +Date: Thu, 31 Jul 2014 11:51:40 -0700 +Subject: [PATCH 3/3] movenc: fix QT chapter track character encoding + +An encoding ("encd") box is required to tell QT that the string is UTF8 +--- + libavformat/movenc.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/libavformat/movenc.c b/libavformat/movenc.c +index c9b0f6e..4d487e9 100644 +--- a/libavformat/movenc.c ++++ b/libavformat/movenc.c +@@ -3196,13 +3196,18 @@ static int mov_create_chapter_track(AVFormatContext *s, int tracknum) + pkt.duration = end - pkt.dts; + + if ((t = av_dict_get(c->metadata, "title", NULL, 0))) { ++ const char encd[12] = { ++ 0x00, 0x00, 0x00, 0x0C, ++ 'e', 'n', 'c', 'd', ++ 0x00, 0x00, 0x01, 0x00 }; + len = strlen(t->value); +- pkt.size = len + 2; ++ pkt.size = len + 2 + 12; + pkt.data = av_malloc(pkt.size); + if (!pkt.data) + return AVERROR(ENOMEM); + AV_WB16(pkt.data, len); + memcpy(pkt.data + 2, t->value, len); ++ memcpy(pkt.data + len + 2, encd, sizeof(encd)); + ff_mov_write_packet(s, &pkt); + av_freep(&pkt.data); + } +-- +1.9.3 + |