From 85058f5d9caa0f9768b155c8963eaed6aa989ed5 Mon Sep 17 00:00:00 2001 From: Peter D'Hoye Date: Wed, 10 Oct 2007 23:26:17 +0000 Subject: 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 --- apps/codecs/wav_enc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'apps/codecs/wav_enc.c') 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; -- cgit v1.2.3