Replaced some yields with sleep(1) to save battery while paused or
playing files which doesn't require cpu boosting. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7103 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b55aaba22f
commit
fbd4088df8
4 changed files with 7 additions and 7 deletions
|
@ -111,7 +111,7 @@ enum codec_status codec_start(struct codec_api* api)
|
|||
file_end = 0;
|
||||
|
||||
while (!*ci->taginfo_ready && !ci->stop_codec)
|
||||
ci->yield();
|
||||
ci->sleep(1);
|
||||
|
||||
frequency_divider = ci->id3->frequency / 100;
|
||||
ci->configure(DSP_SET_FREQUENCY, (int *)ci->id3->frequency);
|
||||
|
|
|
@ -179,7 +179,7 @@ enum codec_status codec_start(struct codec_api* api)
|
|||
}
|
||||
|
||||
while (!*rb->taginfo_ready && !rb->stop_codec)
|
||||
rb->yield();
|
||||
rb->sleep(1);
|
||||
|
||||
/* Create a decoder instance */
|
||||
callbacks.read_func=read_handler;
|
||||
|
@ -263,7 +263,7 @@ enum codec_status codec_start(struct codec_api* api)
|
|||
DEBUGF("Error decoding frame\n");
|
||||
} else {
|
||||
while (!rb->audiobuffer_insert(pcmbuf, n)) {
|
||||
rb->yield();
|
||||
rb->sleep(1);
|
||||
if ( rb->seek_time ) {
|
||||
/* Hmmm, a seek was requested. Throw out the
|
||||
* buffer and go back to the top of the loop.
|
||||
|
|
|
@ -75,7 +75,7 @@ enum codec_status codec_start(struct codec_api* api)
|
|||
return CODEC_ERROR;
|
||||
|
||||
while (!*rb->taginfo_ready && !ci->stop_codec)
|
||||
ci->yield();
|
||||
ci->sleep(1);
|
||||
|
||||
if (ci->id3->frequency != NATIVE_FREQUENCY) {
|
||||
ci->configure(DSP_SET_FREQUENCY, (long *)(ci->id3->frequency));
|
||||
|
@ -190,7 +190,7 @@ enum codec_status codec_start(struct codec_api* api)
|
|||
break;
|
||||
|
||||
while (!ci->audiobuffer_insert ((char *) temp_buffer, nsamples * 4))
|
||||
rb->yield ();
|
||||
rb->sleep (1);
|
||||
|
||||
ci->set_elapsed (WavpackGetSampleIndex (wpc) / sr_100 * 10);
|
||||
}
|
||||
|
|
|
@ -478,7 +478,7 @@ void pcm_flush_fillpos(void)
|
|||
while (!pcm_play_add_chunk(&audiobuffer[audiobuffer_pos],
|
||||
copy_n, pcm_event_handler)) {
|
||||
pcm_boost(false);
|
||||
yield();
|
||||
sleep(1);
|
||||
/* This is a fatal error situation that should never happen. */
|
||||
if (!pcm_playing) {
|
||||
logf("pcm_flush_fillpos error");
|
||||
|
@ -588,7 +588,7 @@ void* pcm_request_buffer(long length, long *realsize)
|
|||
while (audiobuffer_free < length + audiobuffer_fillpos
|
||||
+ CHUNK_SIZE && !crossfade_active) {
|
||||
pcm_boost(false);
|
||||
yield();
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
if (crossfade_active) {
|
||||
|
|
Loading…
Reference in a new issue