Added a vorbis close_func callback to prevent crashing on iphone devices using the tremor vorbis library.

This commit is contained in:
Raynaldo Rivera 2010-02-27 20:51:05 +00:00
parent 09a7d8d6e7
commit fcde0271a4
1 changed files with 6 additions and 1 deletions

View File

@ -41,11 +41,16 @@ namespace cAudio
{
return ((IDataSource*)datasource)->getCurrentPos();
}
int VorbisCloseFunc(void *datasource)
{
return 0;
}
cOggDecoder::cOggDecoder(IDataSource* stream) : IAudioDecoder(stream)
{
vorbisCallbacks.read_func = VorbisRead;
vorbisCallbacks.close_func = NULL;
vorbisCallbacks.close_func = VorbisCloseFunc;
vorbisCallbacks.seek_func = VorbisSeek;
vorbisCallbacks.tell_func = VorbisTell;
Valid = (ov_open_callbacks(Stream,&oggStream,NULL,0,vorbisCallbacks) == 0);