summaryrefslogtreecommitdiffstats
path: root/player/playloop.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-04-23 17:16:54 +0200
committerwm4 <wm4@nowhere>2016-04-23 18:55:24 +0200
commit786f37ae1c77b46b34ed66b4a73c42ff64bfc9b8 (patch)
tree5e300caf595d8a0aa6796f578613bb28ea82caae /player/playloop.c
parentabb3f80998e46dad6e213b476a9de9796f21d9bf (diff)
downloadmpv-786f37ae1c77b46b34ed66b4a73c42ff64bfc9b8.tar.bz2
mpv-786f37ae1c77b46b34ed66b4a73c42ff64bfc9b8.tar.xz
player: cleaner determination of current playback PTS
In particular, this won't overwrite the playback PTS in coverart mode, which actually fixes relative seeks.
Diffstat (limited to 'player/playloop.c')
-rw-r--r--player/playloop.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/player/playloop.c b/player/playloop.c
index 71ecd7ee52..6eadcbc313 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -958,6 +958,17 @@ void run_playloop(struct MPContext *mpctx)
fill_audio_out_buffers(mpctx);
write_video(mpctx);
+ if (mpctx->vo_chain && !mpctx->vo_chain->is_coverart &&
+ mpctx->video_status >= STATUS_PLAYING &&
+ mpctx->video_status < STATUS_EOF)
+ {
+ mpctx->playback_pts = mpctx->video_pts;
+ } else if (mpctx->audio_status >= STATUS_PLAYING &&
+ mpctx->audio_status < STATUS_EOF)
+ {
+ mpctx->playback_pts = playing_audio_pts(mpctx);
+ }
+
if (mpctx->lavfi) {
if (lavfi_process(mpctx->lavfi))
mpctx->sleeptime = 0;
@@ -967,14 +978,6 @@ void run_playloop(struct MPContext *mpctx)
handle_playback_restart(mpctx);
- // Use the audio timestamp if no video, or video is enabled, but has ended.
- if (mpctx->video_status == STATUS_EOF &&
- mpctx->audio_status >= STATUS_PLAYING &&
- mpctx->audio_status < STATUS_EOF)
- {
- mpctx->playback_pts = playing_audio_pts(mpctx);
- }
-
handle_dummy_ticks(mpctx);
update_osd_msg(mpctx);