mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
movenc: fix QT chapter track character encoding
An encoding ("encd") box is required to tell QT that the string is UTF8
This commit is contained in:
parent
da9cc22d5b
commit
b50173a4dd
@ -3196,13 +3196,18 @@ static int mov_create_chapter_track(AVFormatContext *s, int tracknum)
|
|||||||
pkt.duration = end - pkt.dts;
|
pkt.duration = end - pkt.dts;
|
||||||
|
|
||||||
if ((t = av_dict_get(c->metadata, "title", NULL, 0))) {
|
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);
|
len = strlen(t->value);
|
||||||
pkt.size = len + 2;
|
pkt.size = len + 2 + 12;
|
||||||
pkt.data = av_malloc(pkt.size);
|
pkt.data = av_malloc(pkt.size);
|
||||||
if (!pkt.data)
|
if (!pkt.data)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
AV_WB16(pkt.data, len);
|
AV_WB16(pkt.data, len);
|
||||||
memcpy(pkt.data + 2, t->value, len);
|
memcpy(pkt.data + 2, t->value, len);
|
||||||
|
memcpy(pkt.data + len + 2, encd, sizeof(encd));
|
||||||
ff_mov_write_packet(s, &pkt);
|
ff_mov_write_packet(s, &pkt);
|
||||||
av_freep(&pkt.data);
|
av_freep(&pkt.data);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user