mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 21:25:19 -05:00
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
This commit is contained in:
parent
bcdb3217de
commit
85058f5d9c
6 changed files with 33 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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 ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue