From 26bf32c8aacb115528fafae552d576227b08ea7a Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sun, 14 Dec 2008 11:42:47 +0000 Subject: Check that PCM is playing/recording *after* getting the current position from the hardware layer. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19435 a1c6a512-1295-4272-9138-f99709370657 --- apps/pcmbuf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'apps/pcmbuf.c') diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c index b22fd789a6..095b5209eb 100644 --- a/apps/pcmbuf.c +++ b/apps/pcmbuf.c @@ -978,8 +978,9 @@ void pcmbuf_beep(unsigned int frequency, size_t duration, int amplitude) /* Get the currently playing chunk at the current position. */ bufstart = (int16_t *)pcm_play_dma_get_peak_buffer(&i); - if (!bufstart) - return; /* If above isn't implemented, no beepeth */ + /* If above isn't implemented or pcm is stopped, no beepeth. */ + if (!bufstart || !pcm_is_playing()) + return; /* Give 5ms clearance. */ bufstart += NATIVE_FREQUENCY * 4 / 200; -- cgit v1.2.3