1
0
Fork 0
forked from len0rd/rockbox

archos fix blah

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6227 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michiel Van Der Kolk 2005-03-28 00:27:49 +00:00
parent 451dd48adc
commit a87188e8d4

View file

@ -11,6 +11,13 @@ struct pcm pcm;
#define DMA_PORTION (1024) #define DMA_PORTION (1024)
static short buf1_unal[(BUF_SIZE / sizeof(short)) + 2]; // to make sure 4 byte aligned 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* buf1;
static short front_buf[512]; static short front_buf[512];
@ -20,11 +27,6 @@ static short* last_back_pos;
static bool newly_started; static bool newly_started;
static int turns; static int turns;
rcvar_t pcm_exports[] =
{
RCV_END
};
void pcm_init(void) 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*/ 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) 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*/ 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); int shorts_left = ((((unsigned int)buf1) + BUF_SIZE) - ((unsigned int)last_back_pos)) / sizeof(short);
if( shorts_left >= pcm.pos ) if( shorts_left >= pcm.pos )
@ -112,13 +113,25 @@ int pcm_submit(void)
pcm.pos = 0; pcm.pos = 0;
return 1; return 1;
}
#else #else
void pcm_init(void)
{
pcm.hz = 11025;
pcm.stereo = 1;
pcm.buf = buf1_unal;
pcm.len = (BUF_SIZE / sizeof(short));
pcm.pos = 0; 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