summaryrefslogtreecommitdiff
path: root/apps/codecs
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-04-25 19:53:34 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-04-25 19:53:34 +0000
commit205ec3279d32a152f6046ecc6ad66c39f097fa4d (patch)
treefa8bb607ebae23a0b43428ea6850797af83b57a0 /apps/codecs
parent2a2b8d8a8234633779dca0fff5e7ce23ad4c48ed (diff)
downloadrockbox-205ec3279d32a152f6046ecc6ad66c39f097fa4d.tar.gz
rockbox-205ec3279d32a152f6046ecc6ad66c39f097fa4d.zip
Make recording complain about every little file I/O problem (error on close() failure and fsync() failure). Why? I guess we will find out the disk is full about 1/2 sector sooner on average when the file APIs actually detect this correctly. :/
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13262 a1c6a512-1295-4272-9138-f99709370657
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 2292bcc275..51c4344702 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)
181 hdr.ssnd_size = htobe32(data_size + 8); 181 hdr.ssnd_size = htobe32(data_size + 8);
182 182
183 if (ci->lseek(data->rec_file, 0, SEEK_SET) != 0 || 183 if (ci->lseek(data->rec_file, 0, SEEK_SET) != 0 ||
184 ci->write(data->rec_file, &hdr, sizeof (hdr)) != sizeof (hdr)) 184 ci->write(data->rec_file, &hdr, sizeof (hdr)) != sizeof (hdr) ||
185 ci->close(data->rec_file) != 0)
185 { 186 {
186 return false; 187 return false;
187 } 188 }
188 189
189 ci->fsync(data->rec_file);
190 ci->close(data->rec_file);
191 data->rec_file = -1; 190 data->rec_file = -1;
192 191
193 return true; 192 return true;
diff --git a/apps/codecs/mp3_enc.c b/apps/codecs/mp3_enc.c
index daa6cfefa6..08cbb18f03 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)
2329 2329
2330static bool on_end_file(struct enc_file_event_data *data) 2330static bool on_end_file(struct enc_file_event_data *data)
2331{ 2331{
2332 if (!is_file_data_ok(data)) 2332 if (!is_file_data_ok(data) || ci->close(data->rec_file) != 0)
2333 return false; 2333 return false;
2334 2334
2335 ci->fsync(data->rec_file);
2336 ci->close(data->rec_file);
2337 data->rec_file = -1; 2335 data->rec_file = -1;
2338 2336
2339 return true; 2337 return true;
diff --git a/apps/codecs/wav_enc.c b/apps/codecs/wav_enc.c
index ff77f137d2..a11aaa07d6 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)
169 hdr.data_size = htole32(data_size); 169 hdr.data_size = htole32(data_size);
170 170
171 if (ci->lseek(data->rec_file, 0, SEEK_SET) != 0 || 171 if (ci->lseek(data->rec_file, 0, SEEK_SET) != 0 ||
172 ci->write(data->rec_file, &hdr, sizeof (hdr)) != sizeof (hdr)) 172 ci->write(data->rec_file, &hdr, sizeof (hdr)) != sizeof (hdr) ||
173 ci->close(data->rec_file) != 0)
173 { 174 {
174 return false; 175 return false;
175 } 176 }
176 177
177 ci->fsync(data->rec_file);
178 ci->close(data->rec_file);
179 data->rec_file = -1; 178 data->rec_file = -1;
180 179
181 return true; 180 return true;
diff --git a/apps/codecs/wavpack_enc.c b/apps/codecs/wavpack_enc.c
index 7b6484d6cf..744b98721c 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)
294 ci->write(data->rec_file, &h.wpmdh, sizeof (h.wpmdh)) 294 ci->write(data->rec_file, &h.wpmdh, sizeof (h.wpmdh))
295 != sizeof (h.wpmdh) || 295 != sizeof (h.wpmdh) ||
296 ci->write(data->rec_file, &h.rhdr, sizeof (h.rhdr)) 296 ci->write(data->rec_file, &h.rhdr, sizeof (h.rhdr))
297 != sizeof (h.rhdr)) 297 != sizeof (h.rhdr) ||
298 ci->close(data->rec_file) != 0 )
298 { 299 {
299 return false; 300 return false;
300 } 301 }
301 302
302 ci->fsync(data->rec_file);
303 ci->close(data->rec_file);
304 data->rec_file = -1; 303 data->rec_file = -1;
305 304
306 return true; 305 return true;