diff options
Diffstat (limited to 'player/playloop.c')
-rw-r--r-- | player/playloop.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/player/playloop.c b/player/playloop.c index 3cd0e78129..42ebab302c 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -226,9 +226,10 @@ static int mp_seek(MPContext *mpctx, struct seek_params seek, seek.type = MPSEEK_ABSOLUTE; } } + int direction = 0; if (seek.type == MPSEEK_RELATIVE) { seek.type = MPSEEK_ABSOLUTE; - seek.direction = seek.amount > 0 ? 1 : -1; + direction = seek.amount > 0 ? 1 : -1; seek.amount += get_current_time(mpctx); } hr_seek &= seek.type == MPSEEK_ABSOLUTE; // otherwise, no target PTS known @@ -265,9 +266,9 @@ static int mp_seek(MPContext *mpctx, struct seek_params seek, demuxer_style |= SEEK_ABSOLUTE; break; } - if (hr_seek || seek.direction < 0) + if (hr_seek || direction < 0) demuxer_style |= SEEK_BACKWARD; - else if (seek.direction > 0) + else if (direction > 0) demuxer_style |= SEEK_FORWARD; if (hr_seek || opts->mkv_subtitle_preroll) demuxer_style |= SEEK_SUBPREROLL; |