summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2006-04-30 23:18:21 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2006-04-30 23:18:21 +0000
commit67ff2624bfc279418578cef3914b9a93e44b4126 (patch)
treeaf99f18e145f3f6af5626b0f86caaee665a609a0 /firmware
parent8e71f90940359c0663f8b3c3d65eb6e00adfaef6 (diff)
downloadrockbox-67ff2624bfc279418578cef3914b9a93e44b4126.tar.gz
rockbox-67ff2624bfc279418578cef3914b9a93e44b4126.tar.bz2
rockbox-67ff2624bfc279418578cef3914b9a93e44b4126.zip
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
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/audio.h2
-rw-r--r--firmware/mpeg.c6
-rw-r--r--firmware/pcm_record.c8
3 files changed, 10 insertions, 6 deletions
diff --git a/firmware/export/audio.h b/firmware/export/audio.h
index 3ed1323701..6922dab1f6 100644
--- a/firmware/export/audio.h
+++ b/firmware/export/audio.h
@@ -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);
diff --git a/firmware/mpeg.c b/firmware/mpeg.c
index c47c279d24..7034f3896b 100644
--- a/firmware/mpeg.c
+++ b/firmware/mpeg.c
@@ -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,
diff --git a/firmware/pcm_record.c b/firmware/pcm_record.c
index 8d34b345c8..a7d8bc707c 100644
--- a/firmware/pcm_record.c
+++ b/firmware/pcm_record.c
@@ -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);