diff options
| author | Michael Sevakis <jethead71@rockbox.org> | 2008-12-14 11:42:47 +0000 |
|---|---|---|
| committer | Michael Sevakis <jethead71@rockbox.org> | 2008-12-14 11:42:47 +0000 |
| commit | 26bf32c8aacb115528fafae552d576227b08ea7a (patch) | |
| tree | 64e0a4fba6576ebf0b4c23882351a1fb70710929 /apps/pcmbuf.c | |
| parent | a89837ac61c75e335cbb1d722872bb8ae9cbc9b8 (diff) | |
| download | rockbox-26bf32c8aacb115528fafae552d576227b08ea7a.zip rockbox-26bf32c8aacb115528fafae552d576227b08ea7a.tar.gz rockbox-26bf32c8aacb115528fafae552d576227b08ea7a.tar.bz2 rockbox-26bf32c8aacb115528fafae552d576227b08ea7a.tar.xz | |
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
Diffstat (limited to 'apps/pcmbuf.c')
| -rw-r--r-- | apps/pcmbuf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c index b22fd78..095b520 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; |