diff options
author | wm4 <wm4@nowhere> | 2014-03-25 02:32:24 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-03-25 02:32:24 +0100 |
commit | d2e4938c78014f182e0dce0458cb2a45d2f3c418 (patch) | |
tree | d41d7250b38daa93ebe1fb929c24b0a7ef3f0353 /player/loadfile.c | |
parent | 6c2cd08afffa6d4fe5c16144b0c883f6997d0399 (diff) | |
download | mpv-d2e4938c78014f182e0dce0458cb2a45d2f3c418.tar.bz2 mpv-d2e4938c78014f182e0dce0458cb2a45d2f3c418.tar.xz |
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.
Diffstat (limited to 'player/loadfile.c')
-rw-r--r-- | player/loadfile.c | 10 |
1 files changed, 5 insertions, 5 deletions
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); } |