mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
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
This commit is contained in:
parent
a89837ac61
commit
26bf32c8aa
2 changed files with 13 additions and 12 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue