summaryrefslogtreecommitdiffstats
path: root/demux/demux_disc.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_disc.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_disc.c')
-rw-r--r--demux/demux_disc.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/demux/demux_disc.c b/demux/demux_disc.c
index f4c9c34332..6c88bc1adc 100644
--- a/demux/demux_disc.c
+++ b/demux/demux_disc.c
@@ -338,6 +338,10 @@ static int d_open(demuxer_t *demuxer, enum demux_check check)
add_streams(demuxer);
add_stream_chapters(demuxer);
+ double len;
+ if (stream_control(demuxer->stream, STREAM_CTRL_GET_TIME_LENGTH, &len) >= 1)
+ demuxer->duration = len;
+
return 0;
}
@@ -352,13 +356,6 @@ static int d_control(demuxer_t *demuxer, int cmd, void *arg)
struct priv *p = demuxer->priv;
switch (cmd) {
- case DEMUXER_CTRL_GET_TIME_LENGTH: {
- double len;
- if (stream_control(demuxer->stream, STREAM_CTRL_GET_TIME_LENGTH, &len) < 1)
- break;
- *(double *)arg = len;
- return CONTROL_OK;
- }
case DEMUXER_CTRL_RESYNC:
demux_flush(p->slave);
break; // relay to slave demuxer