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.
This commit is contained in:
llyyr 2023-08-26 03:15:14 +05:30 committed by Dudemanguy
parent 0c9d8619e8
commit afdd2fa565
1 changed files with 1 additions and 2 deletions

View File

@ -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)