Permalink
Browse files

use libvorbis provided default file acces callbacks

  • Loading branch information...
1 parent f11395c commit 5d474af45ed32c58efc6c0b0c4a2e62c33057aa5 @urkle urkle committed Dec 9, 2011
View
@@ -108,7 +108,6 @@ SET(all_sources
sources/OAL_Init.cpp
sources/OAL_Loaders.cpp
sources/OAL_LoggerObject.cpp
- sources/OAL_OggHelper.cpp
sources/OAL_OggSample.cpp
sources/OAL_OggStream.cpp
sources/OAL_Playback.cpp
@@ -140,4 +139,4 @@ ADD_EXECUTABLE(SimpleTest
)
TARGET_LINK_LIBRARIES(SimpleTest
OALWrapper
-)
+)
View
@@ -206,10 +206,6 @@
RelativePath=".\sources\OAL_LoggerObject.cpp"
>
</File>
- <File
- RelativePath=".\sources\OAL_OggHelper.cpp"
- >
- </File>
<File
RelativePath=".\sources\OAL_OggSample.cpp"
>
@@ -315,10 +311,6 @@
RelativePath=".\include\OALWrapper\OAL_LowLevelObject.h"
>
</File>
- <File
- RelativePath=".\include\OALWrapper\OAL_OggHelper.h"
- >
- </File>
<File
RelativePath=".\include\OALWrapper\OAL_OggSample.h"
>
@@ -29,7 +29,6 @@
DBF9A48A119B18C100CCFDC9 /* OAL_Init.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A473119B18C100CCFDC9 /* OAL_Init.cpp */; };
DBF9A48B119B18C100CCFDC9 /* OAL_Loaders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A474119B18C100CCFDC9 /* OAL_Loaders.cpp */; };
DBF9A48C119B18C100CCFDC9 /* OAL_LoggerObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A475119B18C100CCFDC9 /* OAL_LoggerObject.cpp */; };
- DBF9A48D119B18C100CCFDC9 /* OAL_OggHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A476119B18C100CCFDC9 /* OAL_OggHelper.cpp */; };
DBF9A48E119B18C100CCFDC9 /* OAL_OggSample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A477119B18C100CCFDC9 /* OAL_OggSample.cpp */; };
DBF9A48F119B18C100CCFDC9 /* OAL_OggStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A478119B18C100CCFDC9 /* OAL_OggStream.cpp */; };
DBF9A490119B18C100CCFDC9 /* OAL_Playback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A479119B18C100CCFDC9 /* OAL_Playback.cpp */; };
@@ -77,7 +76,6 @@
DBF9A2AF119A5FFC00CCFDC9 /* OAL_Loaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_Loaders.h; sourceTree = "<group>"; };
DBF9A2B0119A5FFC00CCFDC9 /* OAL_LoggerObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_LoggerObject.h; sourceTree = "<group>"; };
DBF9A2B1119A5FFC00CCFDC9 /* OAL_LowLevelObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_LowLevelObject.h; sourceTree = "<group>"; };
- DBF9A2B2119A5FFC00CCFDC9 /* OAL_OggHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_OggHelper.h; sourceTree = "<group>"; };
DBF9A2B3119A5FFC00CCFDC9 /* OAL_OggSample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_OggSample.h; sourceTree = "<group>"; };
DBF9A2B4119A5FFC00CCFDC9 /* OAL_OggStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_OggStream.h; sourceTree = "<group>"; };
DBF9A2B5119A5FFC00CCFDC9 /* OAL_Playback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_Playback.h; sourceTree = "<group>"; };
@@ -101,7 +99,6 @@
DBF9A473119B18C100CCFDC9 /* OAL_Init.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_Init.cpp; sourceTree = "<group>"; };
DBF9A474119B18C100CCFDC9 /* OAL_Loaders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_Loaders.cpp; sourceTree = "<group>"; };
DBF9A475119B18C100CCFDC9 /* OAL_LoggerObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_LoggerObject.cpp; sourceTree = "<group>"; };
- DBF9A476119B18C100CCFDC9 /* OAL_OggHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_OggHelper.cpp; sourceTree = "<group>"; };
DBF9A477119B18C100CCFDC9 /* OAL_OggSample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_OggSample.cpp; sourceTree = "<group>"; };
DBF9A478119B18C100CCFDC9 /* OAL_OggStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_OggStream.cpp; sourceTree = "<group>"; };
DBF9A479119B18C100CCFDC9 /* OAL_Playback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_Playback.cpp; sourceTree = "<group>"; };
@@ -215,7 +212,6 @@
DBF9A2AF119A5FFC00CCFDC9 /* OAL_Loaders.h */,
DBF9A2B0119A5FFC00CCFDC9 /* OAL_LoggerObject.h */,
DBF9A2B1119A5FFC00CCFDC9 /* OAL_LowLevelObject.h */,
- DBF9A2B2119A5FFC00CCFDC9 /* OAL_OggHelper.h */,
DBF9A2B3119A5FFC00CCFDC9 /* OAL_OggSample.h */,
DBF9A2B4119A5FFC00CCFDC9 /* OAL_OggStream.h */,
DBF9A2B5119A5FFC00CCFDC9 /* OAL_Playback.h */,
@@ -245,7 +241,6 @@
DBF9A473119B18C100CCFDC9 /* OAL_Init.cpp */,
DBF9A474119B18C100CCFDC9 /* OAL_Loaders.cpp */,
DBF9A475119B18C100CCFDC9 /* OAL_LoggerObject.cpp */,
- DBF9A476119B18C100CCFDC9 /* OAL_OggHelper.cpp */,
DBF9A477119B18C100CCFDC9 /* OAL_OggSample.cpp */,
DBF9A478119B18C100CCFDC9 /* OAL_OggStream.cpp */,
DBF9A479119B18C100CCFDC9 /* OAL_Playback.cpp */,
@@ -356,7 +351,6 @@
DBF9A48A119B18C100CCFDC9 /* OAL_Init.cpp in Sources */,
DBF9A48B119B18C100CCFDC9 /* OAL_Loaders.cpp in Sources */,
DBF9A48C119B18C100CCFDC9 /* OAL_LoggerObject.cpp in Sources */,
- DBF9A48D119B18C100CCFDC9 /* OAL_OggHelper.cpp in Sources */,
DBF9A48E119B18C100CCFDC9 /* OAL_OggSample.cpp in Sources */,
DBF9A48F119B18C100CCFDC9 /* OAL_OggStream.cpp in Sources */,
DBF9A490119B18C100CCFDC9 /* OAL_Playback.cpp in Sources */,
@@ -1,11 +0,0 @@
-/*
- * Copyright 2007-2010 (C) - Frictional Games
- *
- * This file is part of OALWrapper
- *
- * For conditions of distribution and use, see copyright notice in LICENSE
- */
-#include <vorbis/codec.h>
-#include <vorbis/vorbisfile.h>
-
-int _fseek64_wrap(FILE *f,ogg_int64_t off,int whence);
@@ -18,7 +18,6 @@
#include "OAL_Sample.h"
-#include "OAL_OggHelper.h"
//-------------------------------------------------------------------------------
class cOAL_OggSample : public cOAL_Sample
@@ -19,8 +19,7 @@
#include "OAL_Stream.h"
#include "OAL_Helper.h"
-#include "OAL_OggHelper.h"
-
+#include <vorbis/vorbisfile.h>
//------------------------------------------------------------------------
View
@@ -1,28 +0,0 @@
-/*
- * Copyright 2007-2010 (C) - Frictional Games
- *
- * This file is part of OALWrapper
- *
- * For conditions of distribution and use, see copyright notice in LICENSE
- */
-#include "OALWrapper/OAL_OggHelper.h"
-#include <vorbis/codec.h>
-#include <vorbis/vorbisfile.h>
-
-///////////////////////////////////////////////////////////
-// Workaround for linking dynamically in win32
-///////////////////////////////////////////////////////////
-int _fseek64_wrap(FILE *f,ogg_int64_t off,int whence)
-{
- if(f==NULL)return(-1);
- return fseek(f, (long) off,whence);
-}
-
-
-ov_callbacks gCallbacks =
-{
- (size_t (*)(void *, size_t, size_t, void *)) fread,
- (int (*)(void *, ogg_int64_t, int)) _fseek64_wrap,
- (int (*)(void *)) fclose,
- (long (*)(void *)) ftell
-};
@@ -19,9 +19,7 @@
#include <string>
#include <cstring>
-//-------------------------------------------------------------------------------
-
-extern ov_callbacks gCallbacks;
+#include <vorbis/vorbisfile.h>
//-------------------------------------------------------------------------------
@@ -60,7 +58,7 @@ bool cOAL_OggSample::CreateFromFile(const wstring &asFilename)
// If not an Ogg file, set status and exit
OggVorbis_File ovFileHandle;
- if((lOpenResult = ov_open_callbacks(fileHandle, &ovFileHandle, NULL, 0, gCallbacks))<0)
+ if((lOpenResult = ov_open_callbacks(fileHandle, &ovFileHandle, NULL, 0, OV_CALLBACKS_DEFAULT))<0)
{
fclose ( fileHandle );
mbStatus = false;
@@ -20,9 +20,6 @@
#include <stdlib.h>
#include <string>
-
-extern ov_callbacks gCallbacks;
-
//---------------------------------------------------------------------
cOAL_OggStream::cOAL_OggStream(): mbIsValidHandle(false)
@@ -154,7 +151,7 @@ bool cOAL_OggStream::CreateFromFile(const wstring &asFilename)
// If not an Ogg file, set status and exit
lOpenResult = ov_open_callbacks(pStreamFile, &movStreamHandle,
- NULL, 0, gCallbacks);
+ NULL, 0, OV_CALLBACKS_DEFAULT);
if(lOpenResult<0)
{
fclose(pStreamFile);

0 comments on commit 5d474af

Please sign in to comment.