summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-16 17:07:26 +0200
committerwm4 <wm4@nowhere>2014-08-16 17:10:08 +0200
commit14c1d864d9320f5fb2ec7bcecc738b506c73aa69 (patch)
treefa3392b107052382740f26b1a30ede722611bb97
parenta4cfab7ee003fa60cab8d29676f3642830be47db (diff)
downloadmpv-14c1d864d9320f5fb2ec7bcecc738b506c73aa69.tar.bz2
mpv-14c1d864d9320f5fb2ec7bcecc738b506c73aa69.tar.xz
player: cosmetics: make code more compact
-rw-r--r--player/playloop.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/player/playloop.c b/player/playloop.c
index e3d1ada323..2ea6c62665 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -234,12 +234,9 @@ static int mp_seek(MPContext *mpctx, struct seek_params seek,
for (int t = 0; t < mpctx->num_tracks; t++) {
struct track *track = mpctx->tracks[t];
if (track->selected && track->is_external && track->demuxer) {
- double main_new_pos;
- if (seek.type == MPSEEK_ABSOLUTE) {
- main_new_pos = seek.amount;
- } else {
+ double main_new_pos = seek.amount;
+ if (seek.type != MPSEEK_ABSOLUTE)
main_new_pos = get_main_demux_pts(mpctx);
- }
main_new_pos -= get_track_video_offset(mpctx, track);
demux_seek(track->demuxer, main_new_pos, SEEK_ABSOLUTE);
}