summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-17 23:44:31 +0100
committerwm4 <wm4@nowhere>2015-02-17 23:44:31 +0100
commit3efeee446e50c0cd4674137a680e6d3660c74a22 (patch)
treefc40661e191f2f85b0bb85f09ec239e3ded39883 /demux
parent969edb9e0b86500ed0af9c26209ad7000adb5157 (diff)
downloadmpv-3efeee446e50c0cd4674137a680e6d3660c74a22.tar.bz2
mpv-3efeee446e50c0cd4674137a680e6d3660c74a22.tar.xz
demux: chapters without metadata are allowed
Makes some of the following commits slightly simpler. Also fix a typo.
Diffstat (limited to 'demux')
-rw-r--r--demux/demux.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/demux/demux.c b/demux/demux.c
index 61c8e40b8c..842daeef76 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -802,7 +802,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;
@@ -1459,7 +1459,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;
}