forked from len0rd/rockbox
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:
parent
7e0b6880d9
commit
9ff373cb65
2 changed files with 5 additions and 5 deletions
|
|
@ -261,6 +261,7 @@ void* codec_request_buffer_callback(size_t *realsize, size_t reqsize)
|
||||||
while ((int)*realsize > cur_ti->available) {
|
while ((int)*realsize > cur_ti->available) {
|
||||||
yield();
|
yield();
|
||||||
if (ci.stop_codec) {
|
if (ci.stop_codec) {
|
||||||
|
*realsize = 0;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -286,7 +287,7 @@ void codec_advance_buffer_callback(size_t amount)
|
||||||
codecbufused = 0;
|
codecbufused = 0;
|
||||||
buf_ridx = buf_widx;
|
buf_ridx = buf_widx;
|
||||||
cur_ti->available = 0;
|
cur_ti->available = 0;
|
||||||
while ((int)amount < cur_ti->available)
|
while ((int)amount < cur_ti->available && !ci.stop_codec)
|
||||||
yield();
|
yield();
|
||||||
} else {
|
} else {
|
||||||
cur_ti->available -= amount;
|
cur_ti->available -= amount;
|
||||||
|
|
@ -427,7 +428,8 @@ void yield_codecs(void)
|
||||||
#ifndef SIMULATOR
|
#ifndef SIMULATOR
|
||||||
if (!pcm_is_playing())
|
if (!pcm_is_playing())
|
||||||
sleep(5);
|
sleep(5);
|
||||||
while (pcm_is_lowdata())
|
while (pcm_is_lowdata() && !ci.stop_codec &&
|
||||||
|
playing && queue_empty(&audio_queue))
|
||||||
yield();
|
yield();
|
||||||
#else
|
#else
|
||||||
yield();
|
yield();
|
||||||
|
|
|
||||||
|
|
@ -240,18 +240,16 @@ void pcm_play_stop(void)
|
||||||
|
|
||||||
void pcm_play_pause(bool play)
|
void pcm_play_pause(bool play)
|
||||||
{
|
{
|
||||||
|
pcm_paused = !play;
|
||||||
if(pcm_paused && play && pcmbuf_unplayed_bytes)
|
if(pcm_paused && play && pcmbuf_unplayed_bytes)
|
||||||
{
|
{
|
||||||
/* Enable the FIFO and force one write to it */
|
/* Enable the FIFO and force one write to it */
|
||||||
IIS2CONFIG = (pcm_freq << 12) | 0x300;
|
IIS2CONFIG = (pcm_freq << 12) | 0x300;
|
||||||
DCR0 |= DMA_START;
|
DCR0 |= DMA_START;
|
||||||
|
|
||||||
pcm_paused = false;
|
|
||||||
}
|
}
|
||||||
else if(!pcm_paused && !play)
|
else if(!pcm_paused && !play)
|
||||||
{
|
{
|
||||||
IIS2CONFIG = 0x800;
|
IIS2CONFIG = 0x800;
|
||||||
pcm_paused = true;
|
|
||||||
}
|
}
|
||||||
pcm_boost(false);
|
pcm_boost(false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue