summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-08-12 11:10:45 +0200
committerwm4 <wm4@nowhere>2015-08-12 11:11:23 +0200
commit828881816acbfae0451e038c45e63b6784681daa (patch)
tree204b590332a95f2e5778a3e184b676e0e719ac4c /player/command.c
parentc7329e5118d4e26d02f74fed66747392916ceae7 (diff)
downloadmpv-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/command.c')
-rw-r--r--player/command.c6
1 files changed, 1 insertions, 5 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);
}