summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichiel Van Der Kolk <not.valid@email.address>2005-03-28 00:27:49 +0000
committerMichiel Van Der Kolk <not.valid@email.address>2005-03-28 00:27:49 +0000
commita87188e8d4af1ead1334ce2f651e375e60bc5f71 (patch)
treed2dcb66b90b0c55d34db34d03163821d3e0cd46d
parent451dd48adc2ef29fd2f900693393cc9b9b4a849b (diff)
archos fix blah
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6227 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/rockboy/rbsound.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/apps/plugins/rockboy/rbsound.c b/apps/plugins/rockboy/rbsound.c
index 92f824aa3b..7d359d847d 100644
--- a/apps/plugins/rockboy/rbsound.c
+++ b/apps/plugins/rockboy/rbsound.c
@@ -11,6 +11,13 @@ struct pcm pcm;
#define DMA_PORTION (1024)
static short buf1_unal[(BUF_SIZE / sizeof(short)) + 2]; // to make sure 4 byte aligned
+
+rcvar_t pcm_exports[] =
+{
+ RCV_END
+};
+
+#if CONFIG_HWCODEC == MASNONE
static short* buf1;
static short front_buf[512];
@@ -20,11 +27,6 @@ static short* last_back_pos;
static bool newly_started;
static int turns;
-rcvar_t pcm_exports[] =
-{
- RCV_END
-};
-
void pcm_init(void)
{
buf1 = (signed short*)((((unsigned int)buf1_unal) >> 2) << 2); /* here i just make sure that buffer is aligned to 4 bytes*/
@@ -85,7 +87,6 @@ void get_more(unsigned char** start, long* size)
int pcm_submit(void)
{
-#ifdef RBSOUND
while( (turns < 0) && ((((unsigned int)last_back_pos) + pcm.pos * sizeof(short)) > ((unsigned int)SAR0)) && !newly_started) rb->yield(); /* wait until data is passed through DAC or until exit*/
int shorts_left = ((((unsigned int)buf1) + BUF_SIZE) - ((unsigned int)last_back_pos)) / sizeof(short);
if( shorts_left >= pcm.pos )
@@ -112,13 +113,25 @@ int pcm_submit(void)
pcm.pos = 0;
return 1;
+}
#else
+void pcm_init(void)
+{
+ pcm.hz = 11025;
+ pcm.stereo = 1;
+ pcm.buf = buf1_unal;
+ pcm.len = (BUF_SIZE / sizeof(short));
pcm.pos = 0;
- return 0;
-#endif
}
-
-
-
+void pcm_close(void)
+{
+ memset(&pcm, 0, sizeof pcm);
+}
+int pcm_submit(void)
+{
+ pcm.pos =0;
+ return 0;
+}
+#endif