[Scummvm-cvs-logs] SF.net SVN: scummvm:[34345] scummvm/trunk
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Fri Sep 5 13:59:34 CEST 2008
Revision: 34345
http://scummvm.svn.sourceforge.net/scummvm/?rev=34345&view=rev
Author: fingolfin
Date: 2008-09-05 11:59:33 +0000 (Fri, 05 Sep 2008)
Log Message:
-----------
Ported AMIGA specific file buffering 'hack' from class File to StdioStream
Modified Paths:
--------------
scummvm/trunk/backends/fs/stdiostream.cpp
scummvm/trunk/common/file.cpp
Modified: scummvm/trunk/backends/fs/stdiostream.cpp
===================================================================
--- scummvm/trunk/backends/fs/stdiostream.cpp 2008-09-05 11:55:58 UTC (rev 34344)
+++ scummvm/trunk/backends/fs/stdiostream.cpp 2008-09-05 11:59:33 UTC (rev 34345)
@@ -194,6 +194,21 @@
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;
Modified: scummvm/trunk/common/file.cpp
===================================================================
--- scummvm/trunk/common/file.cpp 2008-09-05 11:55:58 UTC (rev 34344)
+++ scummvm/trunk/common/file.cpp 2008-09-05 11:59:33 UTC (rev 34345)
@@ -200,9 +200,11 @@
#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.
+ // 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 (file) {
setvbuf(file, NULL, _IOFBF, 8192);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list