player: make code more obvious

Or at least I think so.
This commit is contained in:
wm4 2014-09-19 23:10:53 +02:00
parent 116d1d0dfa
commit 65e816b3fe
1 changed files with 2 additions and 2 deletions

View File

@ -192,9 +192,9 @@ static int mp_seek(MPContext *mpctx, struct seek_params seek,
if (seek.type == MPSEEK_FACTOR || seek.amount < 0 || if (seek.type == MPSEEK_FACTOR || seek.amount < 0 ||
(seek.type == MPSEEK_ABSOLUTE && seek.amount < mpctx->last_chapter_pts)) (seek.type == MPSEEK_ABSOLUTE && seek.amount < mpctx->last_chapter_pts))
mpctx->last_chapter_seek = -2; mpctx->last_chapter_seek = -2;
if (seek.type == MPSEEK_FACTOR) { if (seek.type == MPSEEK_FACTOR && !mpctx->demuxer->ts_resets_possible) {
double len = get_time_length(mpctx); double len = get_time_length(mpctx);
if (len > 0 && !mpctx->demuxer->ts_resets_possible) { if (len > 0) {
seek.amount = seek.amount * len + get_start_time(mpctx); seek.amount = seek.amount * len + get_start_time(mpctx);
seek.type = MPSEEK_ABSOLUTE; seek.type = MPSEEK_ABSOLUTE;
} }