From 5c1af537af94fdc1af9881d0d8e5c32f46b89e56 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Sun, 20 Jun 2021 21:28:53 +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..3ed12d84 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