aboutsummaryrefslogtreecommitdiff
path: root/backends/fs/stdiostream.cpp
diff options
context:
space:
mode:
authorMax Horn2008-09-05 11:59:33 +0000
committerMax Horn2008-09-05 11:59:33 +0000
commit5308f12c759340577000991e5466e9dd8ae222c4 (patch)
treeb2369e35c9b5a41bbc8cd43d9b0134a678dea13d /backends/fs/stdiostream.cpp
parentd98161fc05a33465f20b19a844dd17058984e12d (diff)
downloadscummvm-rg350-5308f12c759340577000991e5466e9dd8ae222c4.tar.gz
scummvm-rg350-5308f12c759340577000991e5466e9dd8ae222c4.tar.bz2
scummvm-rg350-5308f12c759340577000991e5466e9dd8ae222c4.zip
Ported AMIGA specific file buffering 'hack' from class File to StdioStream
svn-id: r34345
Diffstat (limited to 'backends/fs/stdiostream.cpp')
-rw-r--r--backends/fs/stdiostream.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/backends/fs/stdiostream.cpp b/backends/fs/stdiostream.cpp
index dfb01362e1..70739cab08 100644
--- a/backends/fs/stdiostream.cpp
+++ b/backends/fs/stdiostream.cpp
@@ -194,6 +194,21 @@ void StdioStream::flush() {
StdioStream *StdioStream::makeFromPath(const Common::String &path, bool writeMode) {
FILE *handle = fopen(path.c_str(), writeMode ? "wb" : "rb");
+
+#ifdef __amigaos4__
+ //
+ // Work around for possibility that someone uses AmigaOS "newlib" build
+ // with SmartFileSystem (blocksize 512 bytes), leading to buffer size
+ // being only 512 bytes. "Clib2" sets the buffer size to 8KB, resulting
+ // smooth movie playback. This forces the buffer to be enough also when
+ // using "newlib" compile on SFS.
+ //
+ if (handle && !writeMode) {
+ setvbuf(handle, NULL, _IOFBF, 8192);
+ }
+#endif
+
+
if (handle)
return new StdioStream(handle);
return 0;