summaryrefslogtreecommitdiffstats
path: root/apps/pcmbuf.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-10-06 22:27:27 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-10-06 22:27:27 +0000
commit6077e5b7c85c0d6f5963e4aadb215faf2c4d10d2 (patch)
treea6bc91ee4168e83617e942eeaea46e5523e82420 /apps/pcmbuf.c
parentf6de0d4083a4fcb6da57f271e1f8ccaf715e571d (diff)
downloadrockbox-6077e5b7c85c0d6f5963e4aadb215faf2c4d10d2.tar.gz
rockbox-6077e5b7c85c0d6f5963e4aadb215faf2c4d10d2.tar.bz2
rockbox-6077e5b7c85c0d6f5963e4aadb215faf2c4d10d2.zip
Unify PCM interface just above the hardware driver level for all targets including the sims. Perform lockout of audio callback when changing states. Weird new playback or recording trouble? Check before and after this revision first though things seem quite sound.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15006 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/pcmbuf.c')
-rw-r--r--apps/pcmbuf.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c
index 7e6954c280..a6b82baf25 100644
--- a/apps/pcmbuf.c
+++ b/apps/pcmbuf.c
@@ -24,7 +24,7 @@
#include "panic.h"
#include <kernel.h>
#include "pcmbuf.h"
-#include "pcm_playback.h"
+#include "pcm.h"
#include "logf.h"
#ifndef SIMULATOR
#include "cpu.h"
@@ -154,7 +154,6 @@ static void pcmbuf_callback(unsigned char** start, size_t* size)
crossfade_chunk = pcmbuf_read;
}
-process_new_buffer:
{
/* Send the new buffer to the pcm */
struct pcmbufdesc *pcmbuf_new = pcmbuf_read;
@@ -171,10 +170,6 @@ process_new_buffer:
}
else
{
- /* There may be more data waiting to flush, try to use it */
- if (pcmbuf_flush_fillpos())
- goto process_new_buffer;
-
/* No more buffers */
last_chunksize = 0;
*realsize = 0;
@@ -487,7 +482,12 @@ void pcmbuf_pause(bool pause)
if (pause)
pcm_mute(true);
#endif
- pcm_play_pause(!pause);
+
+ if (pcm_is_playing())
+ pcm_play_pause(!pause);
+ else if (!pause)
+ pcmbuf_play_start();
+
#ifdef PCMBUF_MUTING
if (!pause)
pcm_mute(false);
@@ -823,7 +823,8 @@ static bool prepare_insert(size_t length)
#endif
{
logf("pcm starting");
- pcmbuf_play_start();
+ if (!(audio_status() & AUDIO_STATUS_PAUSE))
+ pcmbuf_play_start();
}
}
else if (pcmbuf_unplayed_bytes <= pcmbuf_watermark)