summaryrefslogtreecommitdiff
path: root/apps/pcmbuf.c
diff options
context:
space:
mode:
authorSteve Bavin <pondlife@pondlife.me>2006-10-15 11:03:26 +0000
committerSteve Bavin <pondlife@pondlife.me>2006-10-15 11:03:26 +0000
commit10befc8e6ed2129143af79cfcfbc0fd5a4fe3d85 (patch)
treee291e383781082b758362cae10a7652b628213df /apps/pcmbuf.c
parentb89b5ba2ee31bd351710670cf5ecc5aa8beb95f3 (diff)
downloadrockbox-10befc8e6ed2129143af79cfcfbc0fd5a4fe3d85.zip
rockbox-10befc8e6ed2129143af79cfcfbc0fd5a4fe3d85.tar.gz
rockbox-10befc8e6ed2129143af79cfcfbc0fd5a4fe3d85.tar.bz2
rockbox-10befc8e6ed2129143af79cfcfbc0fd5a4fe3d85.tar.xz
Don't unboost CPU in an ISR
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11224 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/pcmbuf.c')
-rw-r--r--apps/pcmbuf.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c
index 964ebbc..d8612a4 100644
--- a/apps/pcmbuf.c
+++ b/apps/pcmbuf.c
@@ -94,6 +94,7 @@ static size_t pcmbuf_mix_sample IDATA_ATTR;
static bool low_latency_mode = false;
static bool pcmbuf_flush;
+static volatile bool output_completed = false;
extern struct thread_entry *codec_thread_p;
@@ -115,7 +116,7 @@ void pcmbuf_boost(bool state)
#ifdef HAVE_PRIORITY_SCHEDULING
static bool priority_modified = false;
#endif
-
+
if (crossfade_init || crossfade_active)
return;
@@ -203,14 +204,7 @@ process_new_buffer:
*realsize = 0;
*realstart = NULL;
CALL_IF_EXISTS(pcmbuf_event_handler);
- /* FIXME: We need to find another way to keep the CPU from
- * being left boosted, because this is boosting in interrupt
- * context. This is also not a good thing, because it will
- * result in the CPU being deboosted if there is a legitimate
- * buffer underrun (albeit only temporarily, because someone
- * will reboost it soon, but it will make the skip longer
- * than necessary. */
- pcmbuf_boost(false);
+ output_completed = true;
}
}
}
@@ -1037,3 +1031,12 @@ bool pcmbuf_is_crossfade_enabled(void)
return crossfade_enabled;
}
+bool pcmbuf_output_completed(void)
+{
+ if (output_completed)
+ {
+ output_completed = false;
+ return true;
+ }
+ return false;
+}