aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-07 02:53:30 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-07 02:54:23 +0200
commit1c59419419d2bdff50627ab15fb4abff4cdb3b29 (patch)
tree9e762b37123fa2754337d4bac72ec6bf7d1e2c3f /libavformat
parent403367d5a95c26b3c5d72ae7aca10bae0f58a827 (diff)
parentb50173a4dd47b9c3c89845b781fa958ccf860929 (diff)
downloadffmpeg-1c59419419d2bdff50627ab15fb4abff4cdb3b29.tar.gz
Merge commit 'b50173a4dd47b9c3c89845b781fa958ccf860929'
* commit 'b50173a4dd47b9c3c89845b781fa958ccf860929': movenc: fix QT chapter track character encoding Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/movenc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index dc5f904cd9..20006ef2b4 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3745,13 +3745,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);
}