summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2003-03-10 17:12:27 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2003-03-10 17:12:27 +0000
commit673937d65402b058b5b5bfa5a1bf990c2d218dba (patch)
treed8f556d035919dc3a3c092da12773d09c09e2be6
parent44e51833ed83c165b22026e7943461f419bccc0e (diff)
downloadrockbox-673937d65402b058b5b5bfa5a1bf990c2d218dba.tar.gz
rockbox-673937d65402b058b5b5bfa5a1bf990c2d218dba.zip
Faster disk updates with the flush() function
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3417 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/mpeg.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/firmware/mpeg.c b/firmware/mpeg.c
index 92f11e1b84..c3288dfdac 100644
--- a/firmware/mpeg.c
+++ b/firmware/mpeg.c
@@ -1840,10 +1840,6 @@ static void mpeg_thread(void)
if(mpeg_file < 0)
panicf("recfile: %d", mpeg_file);
-
- close(mpeg_file);
-
- mpeg_file = -1;
break;
case MPEG_STOP:
@@ -1905,10 +1901,6 @@ static void mpeg_thread(void)
mp3buflen - mp3buf_read);
DEBUGF("wrl: %x\n", writelen);
- mpeg_file = open(recording_filename,
- O_WRONLY| O_APPEND);
- if(mpeg_file < 0)
- panicf("rec open: %d", mpeg_file);
rc = write(mpeg_file, mp3buf + mp3buf_read,
writelen);
@@ -1916,13 +1908,10 @@ static void mpeg_thread(void)
if(rc < 0)
panicf("rec wrt: %d", rc);
- rc = close(mpeg_file);
+ rc = flush(mpeg_file);
if(rc < 0)
- panicf("rec cls: %d", rc);
-
- mpeg_file = -1;
- DEBUGF("rc: %x\n", rc);
-
+ panicf("rec fls: %d", rc);
+
mp3buf_read += amount_to_save;
if(mp3buf_read >= mp3buflen)
mp3buf_read = 0;