summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-09-03 12:22:20 +0200
committerwm4 <wm4@nowhere>2020-09-03 12:22:20 +0200
commitb9baa1598a72d1144053819a97665161565a4a3b (patch)
tree4dfad746eb7a5b60d7a948fb155d2559a5ca9e0c
parent177a88f676365c2b08dccb07577e0a7153e3bf99 (diff)
downloadmpv-b9baa1598a72d1144053819a97665161565a4a3b.tar.bz2
mpv-b9baa1598a72d1144053819a97665161565a4a3b.tar.xz
audio: slightly simplify audio_start_ao()
Get rid of an indirection; no behavior change.
-rw-r--r--player/audio.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/player/audio.c b/player/audio.c
index 771fa05502..739122531f 100644
--- a/player/audio.c
+++ b/player/audio.c
@@ -782,13 +782,12 @@ static bool get_sync_pts(struct MPContext *mpctx, double *pts)
// Look whether audio can be started yet - if audio has to start some time
// after video.
-static void check_audio_start(struct MPContext *mpctx, bool force)
+// Caller needs to ensure mpctx->restart_complete is OK
+void audio_start_ao(struct MPContext *mpctx)
{
struct ao_chain *ao_c = mpctx->ao_chain;
if (!ao_c || !ao_c->ao || mpctx->audio_status != STATUS_READY)
return;
- if (!mpctx->restart_complete && !force)
- return;
double pts = MP_NOPTS_VALUE;
if (!get_sync_pts(mpctx, &pts))
return;
@@ -932,13 +931,8 @@ void fill_audio_out_buffers(struct MPContext *mpctx)
}
}
- check_audio_start(mpctx, false);
-}
-
-void audio_start_ao(struct MPContext *mpctx)
-{
- assert(mpctx->audio_status == STATUS_READY);
- check_audio_start(mpctx, true);
+ if (mpctx->restart_complete)
+ audio_start_ao(mpctx); // in case it got delayed
}
// Drop data queued for output, or which the AO is currently outputting.