From a4e766a77fc6b7d3ac2e9cfdbbf28b5e042f90b9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 17 Feb 2015 23:44:31 +0100 Subject: demux: chapters without metadata are allowed Makes some of the following commits slightly simpler. Also fix a typo. (cherry picked from commit 3efeee446e50c0cd4674137a680e6d3660c74a22) --- demux/demux.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/demux/demux.c b/demux/demux.c index e498895aaf..3949f5de18 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -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; } -- cgit v1.2.3