summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-17 23:44:31 +0100
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-02-19 13:39:38 +0900
commita4e766a77fc6b7d3ac2e9cfdbbf28b5e042f90b9 (patch)
tree497bce299d0803df1fb986e57f0a6c6e7846252a
parent57deaa02d573ae28f311d2d0c13105a5d8dfda40 (diff)
downloadmpv-a4e766a77fc6b7d3ac2e9cfdbbf28b5e042f90b9.tar.bz2
mpv-a4e766a77fc6b7d3ac2e9cfdbbf28b5e042f90b9.tar.xz
demux: chapters without metadata are allowed
Makes some of the following commits slightly simpler. Also fix a typo. (cherry picked from commit 3efeee446e50c0cd4674137a680e6d3660c74a22)
-rw-r--r--demux/demux.c5
1 files 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;
}