diff options
author | Peter D'Hoye <peter.dhoye@gmail.com> | 2006-03-09 18:39:45 +0000 |
---|---|---|
committer | Peter D'Hoye <peter.dhoye@gmail.com> | 2006-03-09 18:39:45 +0000 |
commit | 5ecac908a2738e7a83dc0227daef3aaf16787dbc (patch) | |
tree | 817b549f211923d8af407142515f8687a99e4a1b /firmware | |
parent | 40c917132c19cd4b65de553783c6f8d3dbe26b4b (diff) | |
download | rockbox-5ecac908a2738e7a83dc0227daef3aaf16787dbc.tar.gz rockbox-5ecac908a2738e7a83dc0227daef3aaf16787dbc.zip |
Fix by Jvo Studer for bugreport #4799. Recorded bytes counter wasn't updated with pre-recording bytes, causing an issue when file-splitting because of maximum filesize limit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8979 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/pcm_record.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/firmware/pcm_record.c b/firmware/pcm_record.c index 500f014b47..1810717dac 100644 --- a/firmware/pcm_record.c +++ b/firmware/pcm_record.c | |||
@@ -420,7 +420,8 @@ static void pcmrec_callback(bool flush) | |||
420 | ptr++; | 420 | ptr++; |
421 | } | 421 | } |
422 | 422 | ||
423 | num_rec_bytes += CHUNK_SIZE; | 423 | if(is_recording && !is_paused) |
424 | num_rec_bytes += CHUNK_SIZE; | ||
424 | 425 | ||
425 | read2_index++; | 426 | read2_index++; |
426 | if (read2_index >= num_chunks) | 427 | if (read2_index >= num_chunks) |
@@ -460,7 +461,10 @@ static void pcmrec_callback(bool flush) | |||
460 | read_index = 0; | 461 | read_index = 0; |
461 | yield(); | 462 | yield(); |
462 | } | 463 | } |
463 | 464 | ||
465 | /* sync file */ | ||
466 | fsync(wav_file); | ||
467 | |||
464 | logf("done"); | 468 | logf("done"); |
465 | } | 469 | } |
466 | } | 470 | } |
@@ -641,7 +645,7 @@ static void pcmrec_start(void) | |||
641 | peak_left = 0; | 645 | peak_left = 0; |
642 | peak_right = 0; | 646 | peak_right = 0; |
643 | 647 | ||
644 | num_rec_bytes = 0; | 648 | num_rec_bytes = pre_chunks * CHUNK_SIZE; |
645 | num_file_bytes = 0; | 649 | num_file_bytes = 0; |
646 | pause_start_time = 0; | 650 | pause_start_time = 0; |
647 | 651 | ||