summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-02-19 00:14:40 +0100
committerwm4 <wm4@nowhere>2014-02-19 00:41:34 +0100
commit09d873d5d4cb23a0b5a4f378a9ba43910761b485 (patch)
treec620d79a8975feadc0758d1c31b59d214e82bb2e /player/loadfile.c
parente6f543ebec5539853cad0bb449ae441a14bb27c3 (diff)
downloadmpv-09d873d5d4cb23a0b5a4f378a9ba43910761b485.tar.bz2
mpv-09d873d5d4cb23a0b5a4f378a9ba43910761b485.tar.xz
player: fix start time if timeline is used (ordered chapters, EDL)
When timeline was used, and the --start option was not used, the initial seek (needed to switch to the first timeline segment) seeked to -1 due to an oversight.
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index 94a0274297..f062bce27c 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -1322,15 +1322,13 @@ goto_reopen_demuxer: ;
// If there's a timeline force an absolute seek to initialize state
double startpos = rel_time_to_abs(mpctx, opts->play_start, -1);
- if (startpos != -1 || mpctx->timeline) {
- queue_seek(mpctx, MPSEEK_ABSOLUTE, startpos, 0, true);
- execute_queued_seek(mpctx);
- }
if (startpos == -1 && mpctx->resolve_result &&
mpctx->resolve_result->start_time > 0)
- {
- queue_seek(mpctx, MPSEEK_ABSOLUTE, mpctx->resolve_result->start_time,
- 0, true);
+ startpos = mpctx->resolve_result->start_time;
+ if (startpos == -1 && mpctx->timeline)
+ startpos = 0;
+ if (startpos != -1) {
+ queue_seek(mpctx, MPSEEK_ABSOLUTE, startpos, 0, true);
execute_queued_seek(mpctx);
}
if (opts->chapterrange[0] > 0) {