From d2e4938c78014f182e0dce0458cb2a45d2f3c418 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 25 Mar 2014 02:32:24 +0100 Subject: player: use MP_NOPTS_VALUE as rel_time_to_abs() error value And consistently use MP_NOPTS_VALUE as error value for the users of this function. This is better than using -1, especially because negative values can be valid timestamps. --- player/loadfile.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'player/loadfile.c') diff --git a/player/loadfile.c b/player/loadfile.c index 948142fb45..e90c3b6200 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1331,18 +1331,18 @@ goto_reopen_demuxer: ; mpctx->seek = (struct seek_params){ 0 }; // 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->resolve_result && + double startpos = rel_time_to_abs(mpctx, opts->play_start); + if (startpos == MP_NOPTS_VALUE && mpctx->resolve_result && mpctx->resolve_result->start_time > 0) startpos = mpctx->resolve_result->start_time; - if (startpos == -1 && opts->chapterrange[0] > 0) { + if (startpos == MP_NOPTS_VALUE && opts->chapterrange[0] > 0) { double start = chapter_start_time(mpctx, opts->chapterrange[0] - 1); if (start != MP_NOPTS_VALUE) startpos = start; } - if (startpos == -1 && mpctx->timeline) + if (startpos == MP_NOPTS_VALUE && mpctx->timeline) startpos = 0; - if (startpos != -1) { + if (startpos != MP_NOPTS_VALUE) { queue_seek(mpctx, MPSEEK_ABSOLUTE, startpos, 0, true); execute_queued_seek(mpctx); } -- cgit v1.2.3