summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorRudolf Polzer <divVerent@xonotic.org>2014-07-16 15:08:06 +0200
committerRudolf Polzer <divVerent@xonotic.org>2014-07-16 16:18:34 +0200
commit073b2becfe009262356a56e9369f34d842a43b4c (patch)
tree8abe436fd23ccb05c17e4d5bd25e3f3c8d704587 /player
parente257cbfdbb9fabaa118ef826f9bf37caa27e9fd5 (diff)
downloadmpv-073b2becfe009262356a56e9369f34d842a43b4c.tar.bz2
mpv-073b2becfe009262356a56e9369f34d842a43b4c.tar.xz
ao_lavc: Fix design of audio pts handling.
There was confusion about what should go into audio pts calculation and what not (mainly due to the audio push thread). This has been fixed by using the playing - not written - audio pts (which properly takes into account the ao's buffer), and incrementing the samples count only by the amount of samples actually taken from the buffer (unfortunately this now forces us to keep the lock too long for my taste).
Diffstat (limited to 'player')
-rw-r--r--player/audio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/player/audio.c b/player/audio.c
index a63b847a75..d0f78b3643 100644
--- a/player/audio.c
+++ b/player/audio.c
@@ -264,7 +264,7 @@ static int write_to_ao(struct MPContext *mpctx, struct mp_audio *data, int flags
ao_get_format(ao, &out_format);
mpctx->ao_pts = pts;
#if HAVE_ENCODING
- encode_lavc_set_audio_pts(mpctx->encode_lavc_ctx, mpctx->ao_pts);
+ encode_lavc_set_audio_pts(mpctx->encode_lavc_ctx, playing_audio_pts(mpctx));
#endif
if (data->samples == 0)
return 0;