Fixed a null pointer problem which caused crashing. Playback should be

now more stable.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6660 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Miika Pekkarinen 2005-06-10 20:29:35 +00:00
parent 7e0b6880d9
commit 9ff373cb65
2 changed files with 5 additions and 5 deletions

View file

@ -261,6 +261,7 @@ void* codec_request_buffer_callback(size_t *realsize, size_t reqsize)
while ((int)*realsize > cur_ti->available) {
yield();
if (ci.stop_codec) {
*realsize = 0;
return NULL;
}
}
@ -286,7 +287,7 @@ void codec_advance_buffer_callback(size_t amount)
codecbufused = 0;
buf_ridx = buf_widx;
cur_ti->available = 0;
while ((int)amount < cur_ti->available)
while ((int)amount < cur_ti->available && !ci.stop_codec)
yield();
} else {
cur_ti->available -= amount;
@ -427,7 +428,8 @@ void yield_codecs(void)
#ifndef SIMULATOR
if (!pcm_is_playing())
sleep(5);
while (pcm_is_lowdata())
while (pcm_is_lowdata() && !ci.stop_codec &&
playing && queue_empty(&audio_queue))
yield();
#else
yield();

View file

@ -240,18 +240,16 @@ void pcm_play_stop(void)
void pcm_play_pause(bool play)
{
pcm_paused = !play;
if(pcm_paused && play && pcmbuf_unplayed_bytes)
{
/* Enable the FIFO and force one write to it */
IIS2CONFIG = (pcm_freq << 12) | 0x300;
DCR0 |= DMA_START;
pcm_paused = false;
}
else if(!pcm_paused && !play)
{
IIS2CONFIG = 0x800;
pcm_paused = true;
}
pcm_boost(false);
}