ov_read error on macosx

Juan Miguel Martín Muñoz <[email protected]> Fri, 15 Jul 2011 13:48:33 +0200
Newsgroups gmane.comp.multimedia.ogg.vorbis.devel
Message-ID <CADN8KfTSDwsTisKuMyN4cAKv=rsOWOzDT6quZpciVyXcFYKXRQ@mail.gmail.com>
Hi, I have this code to decode ogg data:

  unsigned long PSS_OggStream::DecodeOggVorbis(OggVorbis_File
*psOggVorbisFile, char *pDecodeBuffer, unsigned long ulBufferSize, unsigned
long ulChannels)
  {
  int current_section;
  long lDecodeSize;
  unsigned long ulSamples;
  short *pSamples;

  unsigned long ulBytesDone = 0;
  while (true)
  {
#ifdef WIN32
lDecodeSize = ov_read(psOggVorbisFile, pDecodeBuffer + ulBytesDone,
ulBufferSize - ulBytesDone, 0, 2, 1, &current_section);
#elif MACOSX // El cuarto parametro es lo del big endian de los cojones
lDecodeSize = ov_read(psOggVorbisFile, pDecodeBuffer + ulBytesDone,
ulBufferSize - ulBytesDone, 1, 2, 1, &current_section);
#endif
  if (lDecodeSize > 0)
  {
  ulBytesDone += lDecodeSize;

  if (ulBytesDone >= ulBufferSize)
  break;
  }
  else
  {
  break;
  }
  }

  return ulBytesDone;
  }

This works fine on Windows, but on MacOSX, after ov_read call, pDecodeBuffer
is full of 128, -128, 0... I mean, non sense data.

Any idea???

Thanks!

_______________________________________________
Vorbis-dev mailing list
[email protected]
http://lists.xiph.org/mailman/listinfo/vorbis-dev