diff options
Diffstat (limited to 'player')
-rw-r--r-- | player/command.c | 6 | ||||
-rw-r--r-- | player/playloop.c | 3 |
2 files changed, 2 insertions, 7 deletions
diff --git a/player/command.c b/player/command.c index c64427f930..a74cde2b23 100644 --- a/player/command.c +++ b/player/command.c @@ -805,7 +805,6 @@ static int get_chapter_entry(int item, int action, void *arg, void *ctx) }; int r = m_property_read_sub(props, action, arg); - talloc_free(name); return r; } @@ -1178,11 +1177,8 @@ static int mp_property_chapter_metadata(void *ctx, struct m_property *prop, { MPContext *mpctx = ctx; int chapter = get_current_chapter(mpctx); - if (chapter < 0 || chapter >= mpctx->num_chapters) + if (chapter < 0) return M_PROPERTY_UNAVAILABLE; - if (!mpctx->chapters[chapter].metadata) - return M_PROPERTY_UNAVAILABLE; - return tag_property(action, arg, mpctx->chapters[chapter].metadata); } 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) |