[vorbis-dev] Ports

Brian Havard brianh at kheldar.apana.org.au
Thu Dec 28 00:49:59 PST 2000

On Thu, 28 Dec 2000 17:44:33 +1100, Michael Smith wrote:

>>I've tracked down the problem now. For some reason the 'seekable' test in
>>ov_open_callbacks() (the seek_func(f,0,SEEK_CUR)) screws up the stream. If
>>I take this out and force it to non-seekable it works just fine.
>Very strange. Bug in the libraries, then. Another reason to rewrite that
>code to not use stdio FILE operations for sockets. Not much can be done
>other than that, if we have to deal with standard library bugs.

Yup, I won't worry about this any further if the fdopen method is going to be 
ditched sometime soon. For now I'm using the filthy hack of:

diff -u -r1.34 vorbisfile.c
--- vorbisfile.c	2000/12/21 21:04:41	1.34
+++ vorbisfile.c	2000/12/28 07:26:25
@@ -611,7 +611,9 @@
 int ov_open_callbacks(void *f,OggVorbis_File *vf,char *initial,long ibytes,
     ov_callbacks callbacks)
-  long offset=callbacks.seek_func(f,0,SEEK_CUR);
+  long offset = callbacks.seek_func == (int (*)(void *, ogg_int64_t, int))_fseek64_wrap ?
+                lseek(fileno((FILE *)f), 0, SEEK_CUR) :
+                callbacks.seek_func(f,0,SEEK_CUR);
   int ret;

>>Another small item, I had to add "fflush(opt.instream);" in ogg123.c at
>>line 319 or the request didn't get sent and the 'Dump headers' code ended
>>up in an infinite loop as it doesn't check for EOF.
>Probably just a (reasonable) difference in implementation - I'm guessing on
>unix, it sets it to non-buffered, the OS/2 'emulation' of this doesn't. I
>can add that.

Cool. BTW, only 2 \r\n's are needed to finish an HTTP request (1 blank line), 
not 3 . Harmless though.

 |  Brian Havard                 |  "He is not the messiah!                   |
 |  brianh at kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.

More information about the Vorbis-dev mailing list