diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-03-27 00:06:26 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-03-27 00:06:26 +0300 |
commit | cbe11fc7aa77043b5b9485b01c78f2e5a5e35d9a (patch) | |
tree | 4b3c8551ceca43b61d2e28465f31bf9494bc532b /src/sound_openal.cpp | |
parent | d01387a82f3e6e3fc0f76e5c83a5a07be37d0467 (diff) | |
download | minetest-cbe11fc7aa77043b5b9485b01c78f2e5a5e35d9a.tar.gz minetest-cbe11fc7aa77043b5b9485b01c78f2e5a5e35d9a.tar.bz2 minetest-cbe11fc7aa77043b5b9485b01c78f2e5a5e35d9a.zip |
Do a dumb-ass static string copy for const-incorrect old versions of ov_fopen
Diffstat (limited to 'src/sound_openal.cpp')
-rw-r--r-- | src/sound_openal.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sound_openal.cpp b/src/sound_openal.cpp index e635e0fa1..8d76b69e1 100644 --- a/src/sound_openal.cpp +++ b/src/sound_openal.cpp @@ -116,9 +116,14 @@ SoundBuffer* loadOggFile(const std::string &filepath) char array[BUFFER_SIZE]; // Local fixed size array vorbis_info *pInfo; OggVorbis_File oggFile; - + + // Do a dumb-ass static string copy for old versions of ov_fopen + // because they expect a non-const char* + char nonconst[10000]; + snprintf(nonconst, 10000, "%s", filepath.c_str()); // Try opening the given file - if(ov_fopen(filepath.c_str(), &oggFile) != 0) + //if(ov_fopen(filepath.c_str(), &oggFile) != 0) + if(ov_fopen(nonconst, &oggFile) != 0) { infostream<<"Audio: Error opening "<<filepath<<" for decoding"<<std::endl; return NULL; |