summaryrefslogtreecommitdiffstats
path: root/demux/demux_cue.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-06-20 13:57:58 +0200
committerwm4 <wm4@nowhere>2017-06-20 14:22:10 +0200
commit1890529857a3b963df476f53ca41faacab48a6d2 (patch)
treecad31a2b753e5aa2040dd8d8d8adc34ececebea0 /demux/demux_cue.c
parent5bfbe6dfde01704979dd086d5184ea2e697cb510 (diff)
downloadmpv-1890529857a3b963df476f53ca41faacab48a6d2.tar.bz2
mpv-1890529857a3b963df476f53ca41faacab48a6d2.tar.xz
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.
Diffstat (limited to 'demux/demux_cue.c')
-rw-r--r--demux/demux_cue.c16
1 files changed, 1 insertions, 15 deletions
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