summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2005-06-30 20:02:56 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2005-06-30 20:02:56 +0000
commit87d4d1203c502b7ad0c90f39f3de2b48f7c4f9af (patch)
tree7073e5d076df6ccc2cb328484513777bb1dd61cf
parentf2af800fcb08f8918cbac69d9d70b4d8b60e52ac (diff)
downloadrockbox-87d4d1203c502b7ad0c90f39f3de2b48f7c4f9af.tar.gz
rockbox-87d4d1203c502b7ad0c90f39f3de2b48f7c4f9af.zip
Fixed a crash with pcm audio pausing. This should prevent many
crashes from happening. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6954 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/pcm_playback.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/firmware/pcm_playback.c b/firmware/pcm_playback.c
index 04630f100f..cad835e20e 100644
--- a/firmware/pcm_playback.c
+++ b/firmware/pcm_playback.c
@@ -137,6 +137,7 @@ static void dma_stop(void)
{
pcm_playing = false;
+ DCR0 = 0;
/* Reset the FIFO */
IIS2CONFIG = 0x800;
}
@@ -260,12 +261,19 @@ void pcm_play_pause(bool play)
{
if(pcm_paused && play && pcmbuf_unplayed_bytes)
{
+ logf("unpause");
+ /* Reset chunk size so dma has enough data to fill the fifo. */
+ SAR0 = (unsigned long)next_start;
+ BCR0 = next_size;
/* Enable the FIFO and force one write to it */
IIS2CONFIG = (pcm_freq << 12) | 0x300;
- DCR0 |= DMA_START;
+ DCR0 |= DMA_EEXT | DMA_START;
}
else if(!pcm_paused && !play)
{
+ logf("pause");
+ /* Disable DMA peripheral request. */
+ DCR0 &= ~DMA_EEXT;
IIS2CONFIG = 0x800;
}
pcm_paused = !play;
@@ -283,7 +291,7 @@ void DMA0(void)
int res = DSR0;
DSR0 = 1; /* Clear interrupt */
-
+
/* Stop on error */
if(res & 0x70)
{