summaryrefslogtreecommitdiffstats
path: root/apps/pcmbuf.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2009-02-16 18:45:43 +0000
committerMichael Sevakis <jethead71@rockbox.org>2009-02-16 18:45:43 +0000
commite86ece4d341e674c0ca32caa506bae9c5f2fc860 (patch)
tree1b280923bcf84035943c388479eaba48ae801099 /apps/pcmbuf.c
parent4395c12f4c39cf15e15e37ed518dca4d0f485954 (diff)
downloadrockbox-e86ece4d341e674c0ca32caa506bae9c5f2fc860.tar.gz
rockbox-e86ece4d341e674c0ca32caa506bae9c5f2fc860.zip
Fix too-soon frequency unboost when pcm buffer crosses watermark from the low side. It's supposed to stay boosted until full again. Also align the static beep buffer to 4 bytes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20017 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/pcmbuf.c')
-rw-r--r--apps/pcmbuf.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c
index 6e2234880e..7d2c579e42 100644
--- a/apps/pcmbuf.c
+++ b/apps/pcmbuf.c
@@ -285,20 +285,19 @@ static void pcmbuf_under_watermark(bool under)
{
if (under)
{
+ /* Fill audio buffer by boosting cpu */
+ trigger_cpu_boost();
#ifdef HAVE_PRIORITY_SCHEDULING
/* If buffer is critically low, override UI priority, else
set back to the original priority. */
boost_codec_thread(LOW_DATA(2) && pcm_is_playing());
#endif
- /* Fill audio buffer by boosting cpu */
- trigger_cpu_boost();
}
else
{
#ifdef HAVE_PRIORITY_SCHEDULING
boost_codec_thread(false);
#endif
- cancel_cpu_boost();
}
}
@@ -1016,7 +1015,7 @@ void pcmbuf_beep(unsigned int frequency, size_t duration, int amplitude)
}
else if (nsamples <= MINIBUF_SAMPLES)
{
- static int16_t minibuf[MINIBUF_SAMPLES*2];
+ static int16_t minibuf[MINIBUF_SAMPLES*2] __attribute__((aligned(4)));
/* Use mini buffer */
bufstart = minibuf;
bufend = SKIPBYTES(bufstart, MINIBUF_SIZE);