diff options
author | Michiel Van Der Kolk <not.valid@email.address> | 2005-03-28 00:27:49 +0000 |
---|---|---|
committer | Michiel Van Der Kolk <not.valid@email.address> | 2005-03-28 00:27:49 +0000 |
commit | a87188e8d4af1ead1334ce2f651e375e60bc5f71 (patch) | |
tree | d2dcb66b90b0c55d34db34d03163821d3e0cd46d /apps/plugins/rockboy/rbsound.c | |
parent | 451dd48adc2ef29fd2f900693393cc9b9b4a849b (diff) | |
download | rockbox-a87188e8d4af1ead1334ce2f651e375e60bc5f71.tar.gz rockbox-a87188e8d4af1ead1334ce2f651e375e60bc5f71.zip |
archos fix blah
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6227 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/rockboy/rbsound.c')
-rw-r--r-- | apps/plugins/rockboy/rbsound.c | 35 |
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; | |||
11 | #define DMA_PORTION (1024) | 11 | #define DMA_PORTION (1024) |
12 | 12 | ||
13 | static short buf1_unal[(BUF_SIZE / sizeof(short)) + 2]; // to make sure 4 byte aligned | 13 | static short buf1_unal[(BUF_SIZE / sizeof(short)) + 2]; // to make sure 4 byte aligned |
14 | |||
15 | rcvar_t pcm_exports[] = | ||
16 | { | ||
17 | RCV_END | ||
18 | }; | ||
19 | |||
20 | #if CONFIG_HWCODEC == MASNONE | ||
14 | static short* buf1; | 21 | static short* buf1; |
15 | 22 | ||
16 | static short front_buf[512]; | 23 | static short front_buf[512]; |
@@ -20,11 +27,6 @@ static short* last_back_pos; | |||
20 | static bool newly_started; | 27 | static bool newly_started; |
21 | static int turns; | 28 | static int turns; |
22 | 29 | ||
23 | rcvar_t pcm_exports[] = | ||
24 | { | ||
25 | RCV_END | ||
26 | }; | ||
27 | |||
28 | void pcm_init(void) | 30 | void pcm_init(void) |
29 | { | 31 | { |
30 | buf1 = (signed short*)((((unsigned int)buf1_unal) >> 2) << 2); /* here i just make sure that buffer is aligned to 4 bytes*/ | 32 | 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) | |||
85 | 87 | ||
86 | int pcm_submit(void) | 88 | int pcm_submit(void) |
87 | { | 89 | { |
88 | #ifdef RBSOUND | ||
89 | 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*/ | 90 | 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*/ |
90 | int shorts_left = ((((unsigned int)buf1) + BUF_SIZE) - ((unsigned int)last_back_pos)) / sizeof(short); | 91 | int shorts_left = ((((unsigned int)buf1) + BUF_SIZE) - ((unsigned int)last_back_pos)) / sizeof(short); |
91 | if( shorts_left >= pcm.pos ) | 92 | if( shorts_left >= pcm.pos ) |
@@ -112,13 +113,25 @@ int pcm_submit(void) | |||
112 | 113 | ||
113 | pcm.pos = 0; | 114 | pcm.pos = 0; |
114 | return 1; | 115 | return 1; |
116 | } | ||
115 | #else | 117 | #else |
118 | void pcm_init(void) | ||
119 | { | ||
120 | pcm.hz = 11025; | ||
121 | pcm.stereo = 1; | ||
122 | pcm.buf = buf1_unal; | ||
123 | pcm.len = (BUF_SIZE / sizeof(short)); | ||
116 | pcm.pos = 0; | 124 | pcm.pos = 0; |
117 | return 0; | ||
118 | #endif | ||
119 | } | 125 | } |
120 | 126 | ||
121 | 127 | void pcm_close(void) | |
122 | 128 | { | |
123 | 129 | memset(&pcm, 0, sizeof pcm); | |
130 | } | ||
131 | int pcm_submit(void) | ||
132 | { | ||
133 | pcm.pos =0; | ||
134 | return 0; | ||
135 | } | ||
136 | #endif | ||
124 | 137 | ||