summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2007-10-10 23:26:17 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2007-10-10 23:26:17 +0000
commit85058f5d9caa0f9768b155c8963eaed6aa989ed5 (patch)
treeb26d50bf03fce5d8b7cea32a9bcb34d340c60015 /apps
parentbcdb3217deba791d05ecd46328622831d8ed3b14 (diff)
downloadrockbox-85058f5d9caa0f9768b155c8963eaed6aa989ed5.tar.gz
rockbox-85058f5d9caa0f9768b155c8963eaed6aa989ed5.zip
Fix FS #5852 by trying to properly close and update the recorded file, and give the FAT the correct file info. Add filehandle checks to some file functions.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15072 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/codecs/mp3_enc.c3
-rw-r--r--apps/codecs/wav_enc.c5
-rw-r--r--apps/codecs/wavpack_enc.c3
3 files changed, 5 insertions, 6 deletions
diff --git a/apps/codecs/mp3_enc.c b/apps/codecs/mp3_enc.c
index 08cbb18f03..1ec41ad45e 100644
--- a/apps/codecs/mp3_enc.c
+++ b/apps/codecs/mp3_enc.c
@@ -2329,7 +2329,8 @@ static bool on_start_file(struct enc_file_event_data *data)
static bool on_end_file(struct enc_file_event_data *data)
{
- if (!is_file_data_ok(data) || ci->close(data->rec_file) != 0)
+ /* always _try_ to write the file header, even on error */
+ if (ci->close(data->rec_file) != 0)
return false;
data->rec_file = -1;
diff --git a/apps/codecs/wav_enc.c b/apps/codecs/wav_enc.c
index a11aaa07d6..eb43f8b240 100644
--- a/apps/codecs/wav_enc.c
+++ b/apps/codecs/wav_enc.c
@@ -144,8 +144,7 @@ static bool on_end_file(struct enc_file_event_data *data)
struct riff_header hdr;
uint32_t data_size;
- if (!is_file_data_ok(data))
- return false;
+ /* always _try_ to write the file header, even on error */
if (ci->lseek(data->rec_file, 0, SEEK_SET) != 0 ||
ci->read(data->rec_file, &hdr, sizeof (hdr)) != sizeof (hdr))
@@ -387,7 +386,7 @@ enum codec_status codec_main(void)
/* reset parameters to initial state */
ci->enc_set_parameters(NULL);
-
+
/* main application waits for this flag during encoder removing */
ci->enc_codec_loaded = 0;
diff --git a/apps/codecs/wavpack_enc.c b/apps/codecs/wavpack_enc.c
index 744b98721c..cf58a5973a 100644
--- a/apps/codecs/wavpack_enc.c
+++ b/apps/codecs/wavpack_enc.c
@@ -257,8 +257,7 @@ static bool on_end_file(struct enc_file_event_data *data)
uint32_t data_size;
- if (!is_file_data_ok(data))
- return false;
+ /* always _try_ to write the file header, even on error */
/* read template headers at start */
if (ci->lseek(data->rec_file, 0, SEEK_SET) != 0 ||