From b8cf8c53e7d7ff8133906684583536d9015ae803 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Thu, 24 Jun 2021 14:15:18 +0300 Subject: Don't restart OAL device when switching EAX --- src/audio/oal/aldlist.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/audio/oal/aldlist.h') diff --git a/src/audio/oal/aldlist.h b/src/audio/oal/aldlist.h index 417bd314..bebb6791 100644 --- a/src/audio/oal/aldlist.h +++ b/src/audio/oal/aldlist.h @@ -21,7 +21,7 @@ enum }; struct ALDEVICEINFO { - const char *strDeviceName; + char *strDeviceName; int iMajorVersion; int iMinorVersion; unsigned int uiSourceCount; @@ -33,6 +33,19 @@ struct ALDEVICEINFO { strDeviceName = NULL; Extensions = 0; } + + ~ALDEVICEINFO() + { + delete[] strDeviceName; + strDeviceName = NULL; + } + + void SetName(const char *name) + { + if(strDeviceName) delete[] strDeviceName; + strDeviceName = new char[strlen(name) + 1]; + strcpy(strDeviceName, name); + } }; typedef ALDEVICEINFO *LPALDEVICEINFO; -- cgit v1.2.3