1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-26 02:05:31 +00:00

demux: chapters without metadata are allowed

Makes some of the following commits slightly simpler. Also fix a typo.

(cherry picked from commit 3efeee446e)
This commit is contained in:
wm4 2015-02-17 23:44:31 +01:00 committed by Diogo Franco (Kovensky)
parent 57deaa02d5
commit a4e766a77f

View File

@ -744,7 +744,7 @@ static void demux_export_replaygain(demuxer_t *demuxer)
static void demux_copy(struct demuxer *dst, struct demuxer *src)
{
if (src->events & DEMUX_EVENT_INIT) {
// Note that we do as shallow copies as possible. We expect the date
// Note that we do as shallow copies as possible. We expect the data
// that is not-copied (only referenced) to be immutable.
// This implies e.g. that no chapters are added after initialization.
dst->chapters = src->chapters;
@ -1385,7 +1385,8 @@ struct demux_chapter *demux_copy_chapter_data(struct demux_chapter *c, int num)
for (int n = 0; n < num; n++) {
new[n] = c[n];
new[n].name = talloc_strdup(new, new[n].name);
new[n].metadata = mp_tags_dup(new, new[n].metadata);
if (new[n].metadata)
new[n].metadata = mp_tags_dup(new, new[n].metadata);
}
return new;
}