diff options
author | llyyr <llyyr.public@gmail.com> | 2023-08-26 03:15:14 +0530 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-08-25 22:38:25 +0000 |
commit | afdd2fa5656140c55a0b685e498a89a2249a623a (patch) | |
tree | 226c1129a52cc771290e8f33f674562635776f23 /player/playloop.c | |
parent | 0c9d8619e8abbe64f203fd0b18a02d1a1b48ea37 (diff) | |
download | mpv-afdd2fa5656140c55a0b685e498a89a2249a623a.tar.bz2 mpv-afdd2fa5656140c55a0b685e498a89a2249a623a.tar.xz |
player: use audio pts corresponding to playing audio on EOF
We should account for ao queue when setting playback position on EOF,
previously we were using the pts value corresponding to the start of
the ao queue, rather than the currently playing audio.
This fixes time-remaining being a negative number when mpv seeks to EOF
while playback is paused.
Diffstat (limited to 'player/playloop.c')
-rw-r--r-- | player/playloop.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/player/playloop.c b/player/playloop.c index 02902f17cd..dc74e6b849 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -1085,8 +1085,7 @@ static void handle_playback_time(struct MPContext *mpctx) } else if (mpctx->video_status == STATUS_EOF && mpctx->audio_status == STATUS_EOF) { - double apts = - mpctx->ao_chain ? mpctx->ao_chain->last_out_pts : MP_NOPTS_VALUE; + double apts = playing_audio_pts(mpctx); double vpts = mpctx->video_pts; double mpts = MP_PTS_MAX(apts, vpts); if (mpts != MP_NOPTS_VALUE) |