Recording buffer offset must be passed on to the firmware calls, not the other way around. Should fix yellow builds.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9842 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Peter D'Hoye 2006-04-30 23:18:21 +00:00
parent 8e71f90940
commit 67ff2624bf
5 changed files with 14 additions and 9 deletions

View file

@ -366,7 +366,7 @@ bool radio_screen(void)
audio_stop();
#if CONFIG_CODEC != SWCODEC
audio_init_recording();
audio_init_recording(talk_get_bufsize());
sound_settings_apply();
/* Yes, we use the D/A for monitoring */

View file

@ -552,7 +552,7 @@ bool recording_screen(void)
#if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR)
ata_set_led_enabled(false);
#endif
audio_init_recording();
audio_init_recording(talk_get_bufsize());
sound_set_volume(global_settings.volume);
@ -1555,8 +1555,9 @@ void audio_beep(int duration)
#ifdef SIMULATOR
/* stubs for recording sim */
void audio_init_recording(void)
void audio_init_recording(unsigned int buffer_offset)
{
buffer_offset = buffer_offset;
}
void audio_close_recording(void)

View file

@ -87,7 +87,7 @@ void audio_beep(int duration);
void audio_init_playback(void);
/* audio recording functions */
void audio_init_recording(void);
void audio_init_recording(unsigned int buffer_offset);
void audio_close_recording(void);
void audio_record(const char *filename);
void audio_stop_recording(void);

View file

@ -2127,8 +2127,9 @@ void audio_init_playback(void)
/****************************************************************************
* Recording functions
***************************************************************************/
void audio_init_recording(void)
void audio_init_recording(unsigned int buffer_offset)
{
buffer_offset = buffer_offset;
init_recording_done = false;
queue_post(&mpeg_queue, MPEG_INIT_RECORDING, NULL);
@ -2652,9 +2653,10 @@ void audio_set_recording_gain(int left, int right, int type)
(void)right;
(void)type;
}
void audio_init_recording(void)
void audio_init_recording(unsigned int buffer_offset)
{
/* a dummy */
(void)buffer_offset;
}
void audio_set_recording_options(int frequency, int quality,
int source, int channel_mode,

View file

@ -82,6 +82,7 @@ static short peak_left, peak_right;
#define GET_CHUNK(x) (short*)(&rec_buffer[CHUNK_SIZE*(x)])
static unsigned int rec_buffer_offset;
static unsigned char *rec_buffer; /* Circular recording buffer */
static int num_chunks; /* Number of chunks available in rec_buffer */
@ -136,8 +137,9 @@ void pcm_rec_init(void)
* - Prepare for DMA transfers
*/
void audio_init_recording(void)
void audio_init_recording(unsigned int buffer_offset)
{
rec_buffer_offset = buffer_offset;
init_done = false;
queue_post(&pcmrec_queue, PCMREC_INIT, 0);
@ -820,8 +822,8 @@ static void pcmrec_init(void)
is_paused = false;
is_error = false;
rec_buffer = (unsigned char*)(((unsigned long)audiobuf + talk_get_bufsize()) & ~3);
buffer_size = (long)audiobufend - (long)audiobuf - talk_get_bufsize() - 16;
rec_buffer = (unsigned char*)(((unsigned long)audiobuf + rec_buffer_offset) & ~3);
buffer_size = (long)audiobufend - (long)audiobuf - rec_buffer_offset - 16;
logf("buf size: %d kb", buffer_size/1024);