path: root/apps/voice_thread.c
diff options
authorSt├ęphane Doyon <>2007-11-24 14:21:04 +0000
committerSt├ęphane Doyon <>2007-11-24 14:21:04 +0000
commit686b1144baaf3ae9fec876a5b8a11a90ab468ec6 (patch)
tree84008f64876268652f54b0f33fd869a3a07b3eb2 /apps/voice_thread.c
parent3082a40b0a919c68fe03748e65e02d768cd3e4c9 (diff)
Have voice_wait wait for the PCM buffer to drain. It can only do this if
playback is NOT in progress, but that is indeed the case for the only caller (shutting down message). git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/voice_thread.c')
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/voice_thread.c b/apps/voice_thread.c
index 87702339c8..3782ae8aac 100644
--- a/apps/voice_thread.c
+++ b/apps/voice_thread.c
@@ -181,6 +181,9 @@ void voice_wait(void)
* new clip by the time we wait. This should be resolvable if conditions
* ever require knowing the very clip you requested has finished. */
event_wait(&voice_event, STATE_SIGNALED);
+ /* Wait for PCM buffer to be exhausted. Works only if not playing. */
+ while(!playback_is_playing() && pcm_is_playing())
+ sleep(1);
/* Initialize voice thread data that must be valid upon starting and the