[xiph-commits] r11210 - trunk/vorbis/doc/vorbisfile

msmith at svn.xiph.org msmith at svn.xiph.org
Fri Apr 21 10:59:14 PDT 2006


Author: msmith
Date: 2006-04-21 10:59:10 -0700 (Fri, 21 Apr 2006)
New Revision: 11210

Modified:
   trunk/vorbis/doc/vorbisfile/ov_open.html
Log:
Document ov_open() unsafeness on win32 when dynamically linked.


Modified: trunk/vorbis/doc/vorbisfile/ov_open.html
===================================================================
--- trunk/vorbis/doc/vorbisfile/ov_open.html	2006-04-21 17:01:27 UTC (rev 11209)
+++ trunk/vorbis/doc/vorbisfile/ov_open.html	2006-04-21 17:59:10 UTC (rev 11210)
@@ -97,7 +97,24 @@
 (determining all the logical bitstreams in one physical bitstream, for
 example).  See <a href="threads.html">Thread Safety</a> for other information on using libvorbisfile with threads.
 
+<p> <b> WARNING for windows developers: </b> this function cannot be used on win32 if your application dynamically links to libvorbisfile (see <a href="http://msdn2.microsoft.com/en-us/library/abx4dbyh(VS.80).aspx">this microsoft page</a> for details of why). Instead, you <em>must</em> use ov_open_callbacks(). A simple set of callbacks that will work is:
+<p><pre>
+  static int _fseek64_wrap(FILE *f,ogg_int64_t off,int whence){
+    if(f==NULL)return(-1);
+    return fseek(f,off,whence);
+  }
 
+  ov_callbacks callbacks = {
+    (size_t (*)(void *, size_t, size_t, void *))  fread,
+    (int (*)(void *, ogg_int64_t, int))           _fseek64_wrap,
+    (int (*)(void *))                             fclose,
+    (long (*)(void *))                            ftell
+  };
+
+</pre>
+</p>
+</p>
+
 <br><br>
 <hr noshade>
 <table border=0 width=100%>



More information about the commits mailing list