1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-25 08:12:17 +00:00

player: remove a pointless field

This commit is contained in:
wm4 2014-07-29 01:00:54 +02:00
parent 25ceb3289d
commit 6d15c491b0
2 changed files with 4 additions and 5 deletions

View File

@ -336,8 +336,6 @@ typedef struct MPContext {
double amount; double amount;
int exact; // -1 = disable, 0 = default, 1 = enable int exact; // -1 = disable, 0 = default, 1 = enable
bool immediate; // disable seek delay logic 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; } seek;
/* Heuristic for relative chapter seeks: keep track which chapter /* Heuristic for relative chapter seeks: keep track which chapter

View File

@ -226,9 +226,10 @@ static int mp_seek(MPContext *mpctx, struct seek_params seek,
seek.type = MPSEEK_ABSOLUTE; seek.type = MPSEEK_ABSOLUTE;
} }
} }
int direction = 0;
if (seek.type == MPSEEK_RELATIVE) { if (seek.type == MPSEEK_RELATIVE) {
seek.type = MPSEEK_ABSOLUTE; seek.type = MPSEEK_ABSOLUTE;
seek.direction = seek.amount > 0 ? 1 : -1; direction = seek.amount > 0 ? 1 : -1;
seek.amount += get_current_time(mpctx); seek.amount += get_current_time(mpctx);
} }
hr_seek &= seek.type == MPSEEK_ABSOLUTE; // otherwise, no target PTS known 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; demuxer_style |= SEEK_ABSOLUTE;
break; break;
} }
if (hr_seek || seek.direction < 0) if (hr_seek || direction < 0)
demuxer_style |= SEEK_BACKWARD; demuxer_style |= SEEK_BACKWARD;
else if (seek.direction > 0) else if (direction > 0)
demuxer_style |= SEEK_FORWARD; demuxer_style |= SEEK_FORWARD;
if (hr_seek || opts->mkv_subtitle_preroll) if (hr_seek || opts->mkv_subtitle_preroll)
demuxer_style |= SEEK_SUBPREROLL; demuxer_style |= SEEK_SUBPREROLL;