From 6d15c491b063736d6915e74a9134d1cabde9a663 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 29 Jul 2014 01:00:54 +0200 Subject: player: remove a pointless field --- player/core.h | 2 -- player/playloop.c | 7 ++++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/player/core.h b/player/core.h index 8789060ce8..49ca1e042c 100644 --- a/player/core.h +++ b/player/core.h @@ -336,8 +336,6 @@ typedef struct MPContext { double amount; int exact; // -1 = disable, 0 = default, 1 = enable bool immediate; // disable seek delay logic - // currently not set by commands, only used internally by seek() - int direction; // -1 = backward, 0 = default, 1 = forward } seek; /* Heuristic for relative chapter seeks: keep track which chapter 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; -- cgit v1.2.3