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 /player/playloop.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 'player/playloop.c')
-rw-r--r-- | player/playloop.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/player/playloop.c b/player/playloop.c index 31652e3636..b361f7c11c 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -474,7 +474,6 @@ char *chapter_display_name(struct MPContext *mpctx, int chapter) dname = talloc_asprintf(NULL, "(%d) of %d", chapter + 1, chapter_count); } - talloc_free(name); return dname; } @@ -483,7 +482,7 @@ char *chapter_name(struct MPContext *mpctx, int chapter) { if (chapter < 0 || chapter >= mpctx->num_chapters) return NULL; - return talloc_strdup(NULL, mpctx->chapters[chapter].name); + return mp_tags_get_str(mpctx->chapters[chapter].metadata, "title"); } // returns the start of the chapter in seconds (NOPTS if unavailable) |