diff options
author | Steve Bavin <pondlife@pondlife.me> | 2006-10-15 11:03:26 +0000 |
---|---|---|
committer | Steve Bavin <pondlife@pondlife.me> | 2006-10-15 11:03:26 +0000 |
commit | 10befc8e6ed2129143af79cfcfbc0fd5a4fe3d85 (patch) | |
tree | e291e383781082b758362cae10a7652b628213df /apps/pcmbuf.c | |
parent | b89b5ba2ee31bd351710670cf5ecc5aa8beb95f3 (diff) | |
download | rockbox-10befc8e6ed2129143af79cfcfbc0fd5a4fe3d85.tar.gz rockbox-10befc8e6ed2129143af79cfcfbc0fd5a4fe3d85.zip |
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.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c index 964ebbc901..d8612a4fbc 100644 --- a/apps/pcmbuf.c +++ b/apps/pcmbuf.c | |||
@@ -94,6 +94,7 @@ static size_t pcmbuf_mix_sample IDATA_ATTR; | |||
94 | 94 | ||
95 | static bool low_latency_mode = false; | 95 | static bool low_latency_mode = false; |
96 | static bool pcmbuf_flush; | 96 | static bool pcmbuf_flush; |
97 | static volatile bool output_completed = false; | ||
97 | 98 | ||
98 | extern struct thread_entry *codec_thread_p; | 99 | extern struct thread_entry *codec_thread_p; |
99 | 100 | ||
@@ -115,7 +116,7 @@ void pcmbuf_boost(bool state) | |||
115 | #ifdef HAVE_PRIORITY_SCHEDULING | 116 | #ifdef HAVE_PRIORITY_SCHEDULING |
116 | static bool priority_modified = false; | 117 | static bool priority_modified = false; |
117 | #endif | 118 | #endif |
118 | 119 | ||
119 | if (crossfade_init || crossfade_active) | 120 | if (crossfade_init || crossfade_active) |
120 | return; | 121 | return; |
121 | 122 | ||
@@ -203,14 +204,7 @@ process_new_buffer: | |||
203 | *realsize = 0; | 204 | *realsize = 0; |
204 | *realstart = NULL; | 205 | *realstart = NULL; |
205 | CALL_IF_EXISTS(pcmbuf_event_handler); | 206 | CALL_IF_EXISTS(pcmbuf_event_handler); |
206 | /* FIXME: We need to find another way to keep the CPU from | 207 | output_completed = true; |
207 | * being left boosted, because this is boosting in interrupt | ||
208 | * context. This is also not a good thing, because it will | ||
209 | * result in the CPU being deboosted if there is a legitimate | ||
210 | * buffer underrun (albeit only temporarily, because someone | ||
211 | * will reboost it soon, but it will make the skip longer | ||
212 | * than necessary. */ | ||
213 | pcmbuf_boost(false); | ||
214 | } | 208 | } |
215 | } | 209 | } |
216 | } | 210 | } |
@@ -1037,3 +1031,12 @@ bool pcmbuf_is_crossfade_enabled(void) | |||
1037 | return crossfade_enabled; | 1031 | return crossfade_enabled; |
1038 | } | 1032 | } |
1039 | 1033 | ||
1034 | bool pcmbuf_output_completed(void) | ||
1035 | { | ||
1036 | if (output_completed) | ||
1037 | { | ||
1038 | output_completed = false; | ||
1039 | return true; | ||
1040 | } | ||
1041 | return false; | ||
1042 | } | ||