1
0
Fork 0
forked from len0rd/rockbox

For iriver recording: do not boost while recording unless source is spdif. When saving to disk, boost if needed. Decreased max file size a bit for safety. Increases runtime while recording analog sources.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10159 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Peter D'Hoye 2006-06-30 21:24:20 +00:00
parent f5c319b305
commit e8558e228a
2 changed files with 22 additions and 1 deletions

View file

@ -47,6 +47,7 @@
#include "pcm_playback.h"
#include "pcm_record.h"
extern int boost_counter; /* used for boost check */
/***************************************************************************/
@ -552,12 +553,19 @@ static void pcmrec_callback(bool flush)
if (num_free <= WRITE_THRESHOLD || flush)
{
bool must_boost = (boost_counter ? false : true);
logf("writing: %d (%d)", num_ready, flush);
if(must_boost)
cpu_boost(true);
for (i=0; i<num_ready; i++)
{
if (write(wav_file, GET_CHUNK(read_index), CHUNK_SIZE) != CHUNK_SIZE)
{
if(must_boost)
cpu_boost(false);
logf("pcmrec: write err");
pcmrec_dma_stop();
return;
@ -571,6 +579,9 @@ static void pcmrec_callback(bool flush)
yield();
}
if(must_boost)
cpu_boost(false);
/* sync file */
fsync(wav_file);