summaryrefslogtreecommitdiffstats
path: root/player/timeline/tl_mpv_edl.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/timeline/tl_mpv_edl.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/timeline/tl_mpv_edl.c')
-rw-r--r--player/timeline/tl_mpv_edl.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/player/timeline/tl_mpv_edl.c b/player/timeline/tl_mpv_edl.c
index e11b483935..4cd62fc497 100644
--- a/player/timeline/tl_mpv_edl.c
+++ b/player/timeline/tl_mpv_edl.c
@@ -158,20 +158,20 @@ static double demuxer_chapter_time(struct demuxer *demuxer, int n)
{
if (n < 0 || n >= demuxer->num_chapters)
return -1;
- return demuxer->chapters[n].start / 1e9;
+ return demuxer->chapters[n].pts;
}
// Append all chapters from src to the chapters array.
// Ignore chapters outside of the given time range.
-static void copy_chapters(struct chapter **chapters, int *num_chapters,
+static void copy_chapters(struct demux_chapter **chapters, int *num_chapters,
struct demuxer *src, double start, double len,
double dest_offset)
{
for (int n = 0; n < src->num_chapters; n++) {
double time = demuxer_chapter_time(src, n);
if (time >= start && time <= start + len) {
- struct chapter ch = {
- .start = dest_offset + time - start,
+ struct demux_chapter ch = {
+ .pts = dest_offset + time - start,
.name = talloc_strdup(*chapters, src->chapters[n].name),
};
MP_TARRAY_APPEND(NULL, *chapters, *num_chapters, ch);
@@ -208,7 +208,7 @@ static void resolve_timestamps(struct tl_part *part, struct demuxer *demuxer)
static void build_timeline(struct MPContext *mpctx, struct tl_parts *parts)
{
- struct chapter *chapters = talloc_new(NULL);
+ struct demux_chapter *chapters = talloc_new(NULL);
int num_chapters = 0;
struct timeline_part *timeline = talloc_array_ptrtype(NULL, timeline,
parts->num_parts + 1);
@@ -244,8 +244,8 @@ static void build_timeline(struct MPContext *mpctx, struct tl_parts *parts)
}
// Add a chapter between each file.
- struct chapter ch = {
- .start = starttime,
+ struct demux_chapter ch = {
+ .pts = starttime,
.name = talloc_strdup(chapters, part->filename),
};
MP_TARRAY_APPEND(NULL, chapters, num_chapters, ch);