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_edl.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'demux/demux_edl.c') diff --git a/demux/demux_edl.c b/demux/demux_edl.c index 8b6f402b27..5bab4ae983 100644 --- a/demux/demux_edl.c +++ b/demux/demux_edl.c @@ -199,16 +199,6 @@ static void copy_chapters(struct demux_chapter **chapters, int *num_chapters, } } -// return length of the source in seconds, or -1 if unknown -static double source_get_length(struct demuxer *demuxer) -{ - double time; - // <= 0 means DEMUXER_CTRL_NOTIMPL or DEMUXER_CTRL_DONTKNOW - if (demux_control(demuxer, DEMUXER_CTRL_GET_TIME_LENGTH, &time) <= 0) - time = -1; - return time; -} - static void resolve_timestamps(struct tl_part *part, struct demuxer *demuxer) { if (part->chapter_ts) { @@ -279,7 +269,7 @@ static void build_timeline(struct timeline *tl, struct tl_parts *parts) resolve_timestamps(part, source); - double end_time = source_get_length(source); + double end_time = source->duration; if (end_time >= 0) end_time += source->start_time; -- cgit v1.2.3