summaryrefslogtreecommitdiffstats
path: root/player/audio.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2024-02-24 14:02:41 -0600
committerDudemanguy <random342@airmail.cc>2024-02-26 15:41:34 +0000
commit7051e94e4bacd00e53e88835d28e9d9082de3bb3 (patch)
treed4653f81405099529f009b7f69245f4e5b7dd068 /player/audio.c
parentd5dc1e80259b88ac05ae20f3f8df7e0c6b1bf3d7 (diff)
downloadmpv-7051e94e4bacd00e53e88835d28e9d9082de3bb3.tar.bz2
mpv-7051e94e4bacd00e53e88835d28e9d9082de3bb3.tar.xz
player: remove speed adjustment from playing_audio_pts
When calculating the audio pts, mpv multiplies the ao delay by the current audio speed and subtracts it from the written audio pts. This doesn't really make sense though. mpctx->video_pts is never affected by the playback speed, and this leads to weird behavior like the audio-pts property changing values while paused merely because the playback speed changes. Remove the multiplication and simply subtract the delay by a factor of 1 instead. When updating the av_diff in player/video, this does actually need to take in account the audio speed so we do the calculation there.
Diffstat (limited to 'player/audio.c')
-rw-r--r--player/audio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/player/audio.c b/player/audio.c
index c697142012..72cb440014 100644
--- a/player/audio.c
+++ b/player/audio.c
@@ -634,7 +634,7 @@ double playing_audio_pts(struct MPContext *mpctx)
double pts = written_audio_pts(mpctx);
if (pts == MP_NOPTS_VALUE || !mpctx->ao)
return pts;
- return pts - mpctx->audio_speed * ao_get_delay(mpctx->ao);
+ return pts - ao_get_delay(mpctx->ao);
}
// This garbage is needed for untimed AOs. These consume audio infinitely fast,