Skip to content
Snippets Groups Projects
Commit cbe11fc7 authored by Perttu Ahola's avatar Perttu Ahola
Browse files

Do a dumb-ass static string copy for const-incorrect old versions of ov_fopen

parent d01387a8
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment