summaryrefslogtreecommitdiff
path: root/apps/codecs
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs')
-rw-r--r--apps/codecs/aiff_enc.c5
-rw-r--r--apps/codecs/mp3_enc.c4
-rw-r--r--apps/codecs/wav_enc.c5
-rw-r--r--apps/codecs/wavpack_enc.c5
4 files changed, 7 insertions, 12 deletions
diff --git a/apps/codecs/aiff_enc.c b/apps/codecs/aiff_enc.c
index 2292bcc..51c4344 100644
--- a/apps/codecs/aiff_enc.c
+++ b/apps/codecs/aiff_enc.c
@@ -181,13 +181,12 @@ static bool on_end_file(struct enc_file_event_data *data)
hdr.ssnd_size = htobe32(data_size + 8);
if (ci->lseek(data->rec_file, 0, SEEK_SET) != 0 ||
- ci->write(data->rec_file, &hdr, sizeof (hdr)) != sizeof (hdr))
+ ci->write(data->rec_file, &hdr, sizeof (hdr)) != sizeof (hdr) ||
+ ci->close(data->rec_file) != 0)
{
return false;
}
- ci->fsync(data->rec_file);
- ci->close(data->rec_file);
data->rec_file = -1;
return true;
diff --git a/apps/codecs/mp3_enc.c b/apps/codecs/mp3_enc.c
index daa6cfe..08cbb18 100644
--- a/apps/codecs/mp3_enc.c
+++ b/apps/codecs/mp3_enc.c
@@ -2329,11 +2329,9 @@ 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))
+ if (!is_file_data_ok(data) || ci->close(data->rec_file) != 0)
return false;
- ci->fsync(data->rec_file);
- ci->close(data->rec_file);
data->rec_file = -1;
return true;
diff --git a/apps/codecs/wav_enc.c b/apps/codecs/wav_enc.c
index ff77f13..a11aaa0 100644
--- a/apps/codecs/wav_enc.c
+++ b/apps/codecs/wav_enc.c
@@ -169,13 +169,12 @@ static bool on_end_file(struct enc_file_event_data *data)
hdr.data_size = htole32(data_size);
if (ci->lseek(data->rec_file, 0, SEEK_SET) != 0 ||
- ci->write(data->rec_file, &hdr, sizeof (hdr)) != sizeof (hdr))
+ ci->write(data->rec_file, &hdr, sizeof (hdr)) != sizeof (hdr) ||
+ ci->close(data->rec_file) != 0)
{
return false;
}
- ci->fsync(data->rec_file);
- ci->close(data->rec_file);
data->rec_file = -1;
return true;
diff --git a/apps/codecs/wavpack_enc.c b/apps/codecs/wavpack_enc.c
index 7b6484d..744b987 100644
--- a/apps/codecs/wavpack_enc.c
+++ b/apps/codecs/wavpack_enc.c
@@ -294,13 +294,12 @@ static bool on_end_file(struct enc_file_event_data *data)
ci->write(data->rec_file, &h.wpmdh, sizeof (h.wpmdh))
!= sizeof (h.wpmdh) ||
ci->write(data->rec_file, &h.rhdr, sizeof (h.rhdr))
- != sizeof (h.rhdr))
+ != sizeof (h.rhdr) ||
+ ci->close(data->rec_file) != 0 )
{
return false;
}
- ci->fsync(data->rec_file);
- ci->close(data->rec_file);
data->rec_file = -1;
return true;