diff options
author | wm4 <wm4@nowhere> | 2014-11-02 17:20:04 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-11-02 17:29:41 +0100 |
commit | 969757baa0af99d905a9b8c99f0c92efa4e0fb33 (patch) | |
tree | 2db51b2e3bc89dce550fc1c9fbf31c7471a41fce /demux/demux_lavf.c | |
parent | 1cebd16350229d2ab1441f5061079ce9240fb22f (diff) | |
download | mpv-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 'demux/demux_lavf.c')
-rw-r--r-- | demux/demux_lavf.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index e6b62adb12..8cfcfc449f 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -769,13 +769,9 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check) for (i = 0; i < avfc->nb_chapters; i++) { AVChapter *c = avfc->chapters[i]; - uint64_t start = av_rescale_q(c->start, c->time_base, - (AVRational){1, 1000000000}); - uint64_t end = av_rescale_q(c->end, c->time_base, - (AVRational){1, 1000000000}); t = av_dict_get(c->metadata, "title", NULL, 0); int index = demuxer_add_chapter(demuxer, t ? bstr0(t->value) : bstr0(""), - start, end, i); + c->start * av_q2d(c->time_base), i); mp_tags_copy_from_av_dictionary(demuxer->chapters[index].metadata, c->metadata); } |