[vorbis-dev] Re: [vorbis] Problems running example encoder/decoder
Michael Smith
msmith at labyrinth.net.au
Thu May 11 02:33:24 PDT 2000
>Could you perhaps be attempting this under Windows? I wonder if a windows
>porter forgot to set stdin/stdout to binary mode (by default they'll be text
>mode and the translation will destroy the bitstream).
>
Yes, the current encoder and decoder examples don't set stdin/stdout to
binary mode. I've changed that here, but not committed it - at the time, I
thought a more sophisticated encoder was closer to arriving.
If you want, I'll wrap these changes up in the appropriate #ifdefs, and
commit. The encoder also needs another minor change (I think it's using
rand() instead of random()).
It wasn't so much forgetting to do this as it was just not wanting to make
a complete mess of the examples with ifdefs, since they ARE the only real
sample code (at least in the case of the encoder).
If anyone wants to use the encoder (or decoder) under windows now, you'll
need to add these two lines somewhere near the start of main() in
encoder_example.c
_setmode( _fileno( stdin ), _O_BINARY );
_setmode( _fileno( stdout ), _O_BINARY );
You'll also need to include <io.h> and <fcntl.h>
Finally, I've put up copies of the windows encoder, and the winamp plugin at
http://www.labyrinth.net.au/~msmith/in_vorbis.dll
http://www.labyrinth.net.au/~msmith/example_encoder.exe
for anyone who wants to try this stuff out but doesn't have appropriate
tools, like a compiler.
Michael
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
More information about the Vorbis-dev
mailing list