diff options
author | wm4 <wm4@nowhere> | 2014-08-15 23:32:37 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-08-15 23:32:37 +0200 |
commit | fa7c421588cb856481a948d2a95eef7c9e228b45 (patch) | |
tree | 34ca0ab3d1cac35135b07cb67d4646221d140158 /player/playloop.c | |
parent | 318e8da25071a76a3d88944304ae91f6d25d7f43 (diff) | |
download | mpv-fa7c421588cb856481a948d2a95eef7c9e228b45.tar.bz2 mpv-fa7c421588cb856481a948d2a95eef7c9e228b45.tar.xz |
player: use virtual time for --audio-file with ordered chapters
Apparently users prefer this behavior.
It was used for subtitles too, so move the code to calculate the video
offset into a separate function. Seeking also needs to be fixed.
Fixes #1018.
Diffstat (limited to 'player/playloop.c')
-rw-r--r-- | player/playloop.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/player/playloop.c b/player/playloop.c index ae875f380a..33e3f050cd 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -236,10 +236,11 @@ static int mp_seek(MPContext *mpctx, struct seek_params seek, if (track->selected && track->is_external && track->demuxer) { double main_new_pos; if (seek.type == MPSEEK_ABSOLUTE) { - main_new_pos = seek.amount - mpctx->video_offset; + main_new_pos = seek.amount; } else { 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); } } |