From 41f2b26d11e81095a0d8d370480e0d2459208070 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 7 Mar 2014 15:24:32 +0100 Subject: 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. --- player/playloop.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'player/playloop.c') 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) { -- cgit v1.2.3