[MPlayer-dev-eng] [PATCH] Support large files (>2GiB) on mingw32

Gianluigi Tiesi mplayer at netfarm.it
Mon Jan 29 03:08:11 CET 2007


On Sat, Jan 27, 2007 at 04:10:54PM +0100, Reimar D?ffinger wrote:
> Hello,
> On Sat, Jan 27, 2007 at 10:14:44PM +0800, Zuxy Meng wrote:
> > For some reason MinGW provides off64_t, lseek64, fseeko64 and ftello64
> > instead of FILE_OFFSET_BITS dependent off_t, lseek, fseeko and ftello.
> > Hence the patch. Tested with a 2.3GB avi file and it worked OK: file
> > length were reported correctly and file seeking became usable.
> 
> Get this into MinGW instead:
> http://oss.netfarm.it/mplayer/misc/file64_mingw.diff
> (google cache because the main site is down:
> http://72.14.221.104/search?q=cache:eGs6qurB5q4J:oss.netfarm.it/mplayer/misc/file64_mingw.diff+file64_mingw.diff&hl=en&ct=clnk&cd=1&ie=UTF-8
> )
> 
> This reminds me, http://oss.netfarm.it/mplayer-win32.php seems to be
> quite popular but seems down due to bandwidth problems.
> Does anything speak against offering to host the files on mphq, too?
> The official windows build is usually a bit outdated and might have a
> few usability problems after all (like above patch intentionally not used).
> 
The problem was a bit different, some download manager was making
hundread connection to download a 3mb file, this dos-ed the server
for the other request,
we have the plan to move the site to another server, but since
this server should host other sites that needs to be moved,
the operation it's not trivial, we have to schedule the switch
I hope it will be done in this week.
I would also say thanks to guy that offered me a place to host
my stuff

I've attached the patch to this post.

Bye

-- 
Gianluigi Tiesi <sherpya at netfarm.it>
EDP Project Leader
Netfarm S.r.l. - http://www.netfarm.it/
Free Software: http://oss.netfarm.it/
-------------- next part --------------
diff -ur mingw-runtime-3.10.orig/include/io.h mingw-runtime-3.10/include/io.h
--- mingw-runtime-3.10.orig/include/io.h	2006-07-02 17:05:21.649033600 +0200
+++ mingw-runtime-3.10/include/io.h	2006-07-02 17:05:56.979836800 +0200
@@ -304,6 +304,10 @@
 
 #endif	/* Not _NO_OLDNAMES */
 
+#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
+#define lseek _lseeki64
+#endif
+
 #ifdef	__cplusplus
 }
 #endif
diff -ur mingw-runtime-3.10.orig/include/sys/stat.h mingw-runtime-3.10/include/sys/stat.h
--- mingw-runtime-3.10.orig/include/sys/stat.h	2006-07-02 17:05:21.669062400 +0200
+++ mingw-runtime-3.10/include/sys/stat.h	2006-07-02 17:06:04.270320000 +0200
@@ -186,6 +186,13 @@
 #endif /* _WSTAT_DEFIND */
 #endif /* __MSVCRT__ */
 
+#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
+#undef stat
+#define stat  _stati64
+#define fstat _fstati64
+#define wstat _wstati64
+#endif
+
 #ifdef	__cplusplus
 }
 #endif
diff -ur mingw-runtime-3.10.orig/include/sys/types.h mingw-runtime-3.10/include/sys/types.h
--- mingw-runtime-3.10.orig/include/sys/types.h	2006-07-02 17:05:21.689091200 +0200
+++ mingw-runtime-3.10/include/sys/types.h	2006-07-02 17:06:10.649492800 +0200
@@ -35,7 +35,11 @@
 
 #ifndef	_OFF_T_
 #define	_OFF_T_
+#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
+typedef long long _off_t;
+#else
 typedef long _off_t;
+#endif
 
 #ifndef	_NO_OLDNAMES
 typedef _off_t	off_t;


More information about the MPlayer-dev-eng mailing list