From 1890529857a3b963df476f53ca41faacab48a6d2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 20 Jun 2017 13:57:58 +0200 Subject: demux: get rid of DEMUXER_CTRL_GET_TIME_LENGTH Similar purpose as f34e1a0deea45e. Somehow this is much more natural too, and needs less code. This breaks runtime updates to duration. This could easily be fixed, but no important demuxer does this anyway. Only demux_raw and demux_disc might (the latter for BD/DVD). For the latter it might actually have some importance when changing titles at runtime (I guess?), but guess what, I don't care. --- demux/demux_cue.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'demux/demux_cue.c') diff --git a/demux/demux_cue.c b/demux/demux_cue.c index a8d1176163..941f2a88d9 100644 --- a/demux/demux_cue.c +++ b/demux/demux_cue.c @@ -130,20 +130,6 @@ out: return res; } -// return length of the source in seconds, or -1 if unknown -static double source_get_length(struct demuxer *demuxer) -{ - double get_time_ans; - // <= 0 means DEMUXER_CTRL_NOTIMPL or DEMUXER_CTRL_DONTKNOW - if (demuxer && demux_control(demuxer, DEMUXER_CTRL_GET_TIME_LENGTH, - (void *) &get_time_ans) > 0) - { - return get_time_ans; - } else { - return -1; - } -} - static void build_timeline(struct timeline *tl) { struct priv *p = tl->demuxer->priv; @@ -210,7 +196,7 @@ static void build_timeline(struct timeline *tl) if (i + 1 < track_count && tracks[i].source == tracks[i + 1].source) { duration = tracks[i + 1].start - tracks[i].start; } else { - duration = source_get_length(source); + duration = source->duration; // Two cases: 1) last track of a single-file cue, or 2) any track of // a multi-file cue. We need to do this for 1) only because the // timeline needs to be terminated with the length of the last -- cgit v1.2.3