From 8e71f90940359c0663f8b3c3d65eb6e00adfaef6 Mon Sep 17 00:00:00 2001 From: Peter D'Hoye Date: Sun, 30 Apr 2006 22:28:45 +0000 Subject: The recording buffer should not try to use the voice buffer, so map our buffer after it. On swcodec targets, recording always uses this buffer so always notify the others that we did. Fixes bug 4754. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9841 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/recording.c | 12 ++++++++---- firmware/pcm_record.c | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index 172689372f..0d414292b2 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -320,11 +320,11 @@ static void trigger_listener(int trigger_status) case TRIG_GO: if((audio_status() & AUDIO_STATUS_RECORD) != AUDIO_STATUS_RECORD) { - talk_buffer_steal(); /* we use the mp3 buffer */ - audio_record(rec_create_filename(path_buffer)); + talk_buffer_steal(); /* we use the mp3 buffer */ + audio_record(rec_create_filename(path_buffer)); - /* give control to mpeg thread so that it can start recording */ - yield(); yield(); yield(); + /* give control to mpeg thread so that it can start recording*/ + yield(); yield(); yield(); } /* if we're already recording this is a retrigger */ @@ -567,7 +567,9 @@ bool recording_screen(void) #endif peak_meter_enabled = true; +#if CONFIG_CODEC != SWCODEC if (global_settings.rec_prerecord_time) +#endif talk_buffer_steal(); /* will use the mp3 buffer */ audio_set_recording_options(global_settings.rec_frequency, @@ -905,7 +907,9 @@ bool recording_screen(void) } settings_save(); +#if CONFIG_CODEC != SWCODEC if (global_settings.rec_prerecord_time) +#endif talk_buffer_steal(); /* will use the mp3 buffer */ audio_set_recording_options(global_settings.rec_frequency, diff --git a/firmware/pcm_record.c b/firmware/pcm_record.c index 8805e73157..8d34b345c8 100644 --- a/firmware/pcm_record.c +++ b/firmware/pcm_record.c @@ -820,8 +820,8 @@ static void pcmrec_init(void) is_paused = false; is_error = false; - rec_buffer = (unsigned char*)(((unsigned long)audiobuf) & ~3); - buffer_size = (long)audiobufend - (long)audiobuf - 16; + rec_buffer = (unsigned char*)(((unsigned long)audiobuf + talk_get_bufsize()) & ~3); + buffer_size = (long)audiobufend - (long)audiobuf - talk_get_bufsize() - 16; logf("buf size: %d kb", buffer_size/1024); -- cgit v1.2.3