Skip to content

Commit 62dbafd

Browse files
authored
Merge pull request #150 from chenxiaolong/fsync
RecorderThread: Force fsync prior to closing output file descriptors
2 parents e0631a0 + 1982d0b commit 62dbafd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/src/main/java/com/chiller3/bcr/RecorderThread.kt

+3
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ class RecorderThread(
175175
try {
176176
openFile(outputFile, true).use {
177177
recordUntilCancelled(it)
178+
Os.fsync(it.fileDescriptor)
178179
}
179180
} finally {
180181
val finalFilename = synchronized(filenameLock) { filename }
@@ -362,6 +363,8 @@ class RecorderThread(
362363

363364
remain -= ret
364365
}
366+
367+
Os.fsync(targetPfd.fileDescriptor)
365368
}
366369
}
367370

0 commit comments

Comments
 (0)