summaryrefslogtreecommitdiffstats
path: root/apps/pcmbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/pcmbuf.c')
-rw-r--r--apps/pcmbuf.c5
1 files changed, 3 insertions, 2 deletions
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;