summaryrefslogtreecommitdiffstats
path: root/player/playloop.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-03-07 15:24:32 +0100
committerwm4 <wm4@nowhere>2014-03-09 00:19:31 +0100
commit41f2b26d11e81095a0d8d370480e0d2459208070 (patch)
tree1b665e392be25795b8fade6d0487609f73ac90d2 /player/playloop.c
parent74b7001500c0901b095986fafe7dca3e5c23c7f2 (diff)
downloadmpv-41f2b26d11e81095a0d8d370480e0d2459208070.tar.bz2
mpv-41f2b26d11e81095a0d8d370480e0d2459208070.tar.xz
audio/out: make ao struct opaque
We want to move the AO to its own thread. There's no technical reason for making the ao struct opaque to do this. But it helps us sleep at night, because we can control access to shared state better.
Diffstat (limited to 'player/playloop.c')
-rw-r--r--player/playloop.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/player/playloop.c b/player/playloop.c
index 0b926cae36..c5dd55e396 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -982,7 +982,7 @@ void run_playloop(struct MPContext *mpctx)
mpctx->stop_play = PT_NEXT_ENTRY;
}
- if (mpctx->d_audio && !mpctx->restart_playback && !mpctx->ao->untimed) {
+ if (mpctx->d_audio && !mpctx->restart_playback && !ao_untimed(mpctx->ao)) {
int status = fill_audio_out_buffers(mpctx, endpts);
full_audio_buffers = status >= 0;
// Not at audio stream EOF yet
@@ -1193,10 +1193,11 @@ void run_playloop(struct MPContext *mpctx)
video_left &= mpctx->sync_audio_to_video; // force no-video semantics
if (mpctx->d_audio && (mpctx->restart_playback ? !video_left :
- mpctx->ao->untimed && (mpctx->delay <= 0 ||
- !video_left))) {
+ ao_untimed(mpctx->ao) && (mpctx->delay <= 0 ||
+ !video_left)))
+ {
int status = fill_audio_out_buffers(mpctx, endpts);
- full_audio_buffers = status >= 0 && !mpctx->ao->untimed;
+ full_audio_buffers = status >= 0 && !ao_untimed(mpctx->ao);
// Not at audio stream EOF yet
audio_left = status > -2;
}
@@ -1286,7 +1287,7 @@ void run_playloop(struct MPContext *mpctx)
if (mpctx->restart_playback)
sleeptime = 0;
if (mpctx->d_audio && !mpctx->paused) {
- if (mpctx->ao->untimed) {
+ if (ao_untimed(mpctx->ao)) {
if (!video_left)
audio_sleep = 0;
} else if (full_audio_buffers) {