summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-02 17:20:04 +0100
committerwm4 <wm4@nowhere>2014-11-02 17:29:41 +0100
commit969757baa0af99d905a9b8c99f0c92efa4e0fb33 (patch)
tree2db51b2e3bc89dce550fc1c9fbf31c7471a41fce /player/loadfile.c
parent1cebd16350229d2ab1441f5061079ce9240fb22f (diff)
downloadmpv-969757baa0af99d905a9b8c99f0c92efa4e0fb33.tar.bz2
mpv-969757baa0af99d905a9b8c99f0c92efa4e0fb33.tar.xz
player: always use demux_chapter
Instead of defining a separate data structure in the core. For some odd reason, demux_chapter exported the chapter time in nano-seconds. Change that to the usual timestamps (rename the field to make any code relying on this to fail compilation), and also remove the unused chapter end time.
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index a7905a8a36..efca08519c 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -797,16 +797,8 @@ static void load_chapters(struct MPContext *mpctx)
}
if (src && !mpctx->chapters) {
talloc_free(mpctx->chapters);
- int count = src->num_chapters;
- mpctx->chapters = talloc_array(NULL, struct chapter, count);
- mpctx->num_chapters = count;
- for (int n = 0; n < count; n++) {
- struct demux_chapter *dchapter = &src->chapters[n];
- mpctx->chapters[n] = (struct chapter){
- .start = dchapter->start / 1e9,
- .name = talloc_strdup(mpctx->chapters, dchapter->name),
- };
- }
+ mpctx->num_chapters = src->num_chapters;
+ mpctx->chapters = demux_copy_chapter_data(src->chapters, src->num_chapters);
}
if (free_src) {
struct stream *s = src->stream;