[vorbis] Using vorbisfile with an in-memory file instead of FILE*

Olaf van der Spek Olaf at XCC.TMFWeb.NL
Fri Dec 29 00:15:33 PST 2000



----- Original Message -----
From: "Michael Smith" <msmith at labyrinth.net.au>
To: <vorbis at xiph.org>
Sent: Friday, December 29, 2000 1:45 AM
Subject: Re: [vorbis] Using vorbisfile with an in-memory file instead of
FILE*

>
> >> If you rewind AND specify initial/ibytes, then the raw data gets read
in
> >> twice, which isn't permitted (if this is the whole file, then you've
> >
> >I didn't do that.
>
> From the code and explanation given, I could only assume that you had.

int ogg_test()
{
 int error = 0;
 FILE* g = fopen("c:/temp/bp.ogg", "rb");
 fseek(g, 0, SEEK_END);
 int cb_d = ftell(g);
 rewind(g);
 char* d = new char[cb_d];
 fread(d, 1, cb_d, g);
 fclose(g);
 FILE* f = tmpfile();
 OggVorbis_File vf;
 if (!f)
  error = 1;
 else
 {
  if (ov_open(f, &vf, d, cb_d) < 0)

>
> >Callbacks are done, see code. I was indeed testing and was wondering why
it
> >didn't work.
>
> Should work. I don't have a satisfactory explanation for why it doesn't.
If
> you could provide a (minimal) example where it fails (the whole thing,
> rather than just bits of it), I'll try and track it down.

Ok, the above code should be the whole example that doesn't use my own
functions.
It hangs on ov_open.

> Or just do it the way it's designed to be used, and return appropriate
> pointers into your memory buffers from the callbacks.

I already wrote null callbacks and that worked fine (thanks to you for the
help).

--- >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-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 mailing list