diff options
author | wm4 <wm4@nowhere> | 2015-08-12 11:10:45 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-08-12 11:11:23 +0200 |
commit | 828881816acbfae0451e038c45e63b6784681daa (patch) | |
tree | 204b590332a95f2e5778a3e184b676e0e719ac4c /demux/demux_edl.c | |
parent | c7329e5118d4e26d02f74fed66747392916ceae7 (diff) | |
download | mpv-828881816acbfae0451e038c45e63b6784681daa.tar.bz2 mpv-828881816acbfae0451e038c45e63b6784681daa.tar.xz |
demux: remove redundant demux_chapter.name field
Instead, force everyone to use the metadata struct and set a "title"
field. This is only a problem for the timeline producers, which set up
chapters manually. (They do this because a timeline is a separate
struct.)
This fixes the behavior of the chapter-metadata property, which never
returned a "title" property for e.g. ordered chapters.
Diffstat (limited to 'demux/demux_edl.c')
-rw-r--r-- | demux/demux_edl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/demux/demux_edl.c b/demux/demux_edl.c index d46f96e025..9ba0307487 100644 --- a/demux/demux_edl.c +++ b/demux/demux_edl.c @@ -167,7 +167,7 @@ static void copy_chapters(struct demux_chapter **chapters, int *num_chapters, if (time >= start && time <= start + len) { struct demux_chapter ch = { .pts = dest_offset + time - start, - .name = talloc_strdup(*chapters, src->chapters[n].name), + .metadata = mp_tags_dup(*chapters, src->chapters[n].metadata), }; MP_TARRAY_APPEND(NULL, *chapters, *num_chapters, ch); } @@ -238,8 +238,9 @@ static void build_timeline(struct timeline *tl, struct tl_parts *parts) // Add a chapter between each file. struct demux_chapter ch = { .pts = starttime, - .name = talloc_strdup(tl, part->filename), + .metadata = talloc_zero(tl, struct mp_tags), }; + mp_tags_set_str(ch.metadata, "title", part->filename); MP_TARRAY_APPEND(tl, tl->chapters, tl->num_chapters, ch); // Also copy the source file's chapters for the relevant parts |