summaryrefslogtreecommitdiffstats
path: root/src/audio
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-07-22 13:56:28 +0200
committereray orçunus <erayorcunus@gmail.com>2020-07-22 17:51:28 +0200
commit1dc6fbda1fbd9a731eb20b3ef71c3dda989e511e (patch)
tree5578c27b5739341d34def86586a68f1f1129e1bb /src/audio
parentREADME 64-bit preparation (diff)
downloadre3-1dc6fbda1fbd9a731eb20b3ef71c3dda989e511e.tar
re3-1dc6fbda1fbd9a731eb20b3ef71c3dda989e511e.tar.gz
re3-1dc6fbda1fbd9a731eb20b3ef71c3dda989e511e.tar.bz2
re3-1dc6fbda1fbd9a731eb20b3ef71c3dda989e511e.tar.lz
re3-1dc6fbda1fbd9a731eb20b3ef71c3dda989e511e.tar.xz
re3-1dc6fbda1fbd9a731eb20b3ef71c3dda989e511e.tar.zst
re3-1dc6fbda1fbd9a731eb20b3ef71c3dda989e511e.zip
Diffstat (limited to '')
-rw-r--r--src/audio/oal/aldlist.cpp3
-rw-r--r--src/audio/oal/stream.cpp9
2 files changed, 10 insertions, 2 deletions
diff --git a/src/audio/oal/aldlist.cpp b/src/audio/oal/aldlist.cpp
index 3e86b1d7..881418c1 100644
--- a/src/audio/oal/aldlist.cpp
+++ b/src/audio/oal/aldlist.cpp
@@ -27,6 +27,7 @@
#ifndef _WIN32
#define _stricmp strcasecmp
#define _strnicmp strncasecmp
+#define _strdup strdup
#endif
#ifdef AUDIO_OAL
@@ -71,7 +72,7 @@ ALDeviceList::ALDeviceList()
if ((bNewName) && (actualDeviceName != NULL) && (strlen(actualDeviceName) > 0)) {
ALDEVICEINFO ALDeviceInfo;
ALDeviceInfo.bSelected = true;
- ALDeviceInfo.strDeviceName = actualDeviceName;
+ ALDeviceInfo.strDeviceName = _strdup(actualDeviceName);
alcGetIntegerv(device, ALC_MAJOR_VERSION, sizeof(int), &ALDeviceInfo.iMajorVersion);
alcGetIntegerv(device, ALC_MINOR_VERSION, sizeof(int), &ALDeviceInfo.iMinorVersion);
diff --git a/src/audio/oal/stream.cpp b/src/audio/oal/stream.cpp
index 34518f54..5639bd12 100644
--- a/src/audio/oal/stream.cpp
+++ b/src/audio/oal/stream.cpp
@@ -5,7 +5,11 @@
#include "sampman.h"
#ifdef _WIN32
+
+// TODO: This is due to version difference of 32-bit libmpg123 and 64-bit libmpg123, fix it
+#ifndef _WIN64
typedef long ssize_t;
+#endif
#pragma comment( lib, "libsndfile-1.lib" )
#pragma comment( lib, "libmpg123.lib" )
#else
@@ -166,8 +170,11 @@ public:
size_t size;
int err = mpg123_read(m_pMH, (unsigned char *)buffer, GetBufferSize(), &size);
+#if defined(__LP64__) || defined(_WIN64)
+ assert("We can't handle audio files more then 2 GB yet :shrug:" && (size < UINT32_MAX));
+#endif
if (err != MPG123_OK && err != MPG123_DONE) return 0;
- return size;
+ return (uint32)size;
}
};