[vorbis] Vorbisfile Problem...

Ryan Ashley Lord_Dakron at hotmail.com
Wed Feb 18 14:48:19 PST 2004



Sure, here is the function to open an OGG file, which is where the freeze occurs.  I placed commands to log everything to file before I started posting here, and it loggedright up to the ov_open() line, then nothing.  Those logging functions are gone now, since I know what line is causing my problem.  The 'pOVFile' is a pointer, which gets allocated in the function, as you can see.  As you can see, everything is checked before I attempt to use the function.  I should also note that I am now putting in a check to see if 'Filename' is null.  I just noticed that, even though fopen would return null if it was.  Thanks for the help.

bool OGGDATA::OpenOGG(char *Filename)
  {
  int Result;

  if(pOVFile != NULL)
    {
    ov_clear(pOVFile);
    free(pOVFile);
    }

  if(pFile != NULL)
    fclose(pFile);

  if((pOVFile = (OggVorbis_File*)malloc(sizeof(OggVorbis_File))) == NULL)
    return false;

  if((pFile = fopen(Filename, "rb")) == NULL)
    return false;

  Result = ov_open(pFile, pOVFile, NULL, 0);
  switch(Result)
    {
    case 0:
      break;

    case OV_EREAD:
      fclose(pFile);
      return false;

    case OV_ENOTVORBIS:
      fclose(pFile);
      return false;

    case OV_EVERSION:
      fclose(pFile);
      return false;

    case OV_EBADHEADER:
      fclose(pFile);
      return false;

    case OV_EFAULT:
      fclose(pFile);
      return false;
    }

  return true;
  }
  ----- Original Message ----- 
  From: John Edwards 
  To: vorbis at xiph.org 
  Sent: Wednesday, February 18, 2004 1:44 PM
  Subject: Re: [vorbis] Vorbisfile Problem...

<p>  Can you post the relevant bit of code? It's a bit difficult to comment without some more detail.

  John

    ----- Original Message ----- 
    From: Ryan Ashley 
    To: vorbis at xiph.org 
    Sent: Wednesday, February 18, 2004 7:15 AM
    Subject: [vorbis] Vorbisfile Problem...

<p>       OK, I have a minor problem with the 'vorbisfile' libraries.  I copied both the normal and dynamic DLLs to my program directory, and they load fine.  Thing is, if I link with 'vorbisfile.lib' and use 'ov_open', the application just locks up.  If I link with 'vorbisfile_d.lib' and use the function, Windows brings up a standard crash window, and I can just use that to close it.  Why's this happening?  I get no errors or warnings upon compile.
       Now before some of you recomend I download the source and compile it, then use those libraries, how hard would that be?  I mean I can grasp compiling to library or DLL, but how many changes would I need to make to the sources, if any?  If it's a simple matter of downloading the source and running bcc32, then it'll be cake.  However, I don't think that will fix my problem.  The libraries work just fine right now, as far as errors or warnings are concerned.  So, is it really necesarry to do all that JUST to test compiling?
       Other than that, the application is ready to go.  It is a freeware audio player that currently supports ogg and wav formats.  It is 100% portable to Unix/Linux and Mac because it uses OpenAL for playback.  About the only thing not portable is the skinning method, since I have to code it to skin M$ Windows.  Anyway, once I can decode the ogg samples to my buffer to send to OpenAL, I'll be releasing this on my old GeoCities website.  Thanks for the help!

       -Seph

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