aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/ALc.c15
-rw-r--r--OpenAL32/Include/alMain.h3
2 files changed, 14 insertions, 4 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 458a6874..fea0320d 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1925,9 +1925,12 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
ALCdevice_Unlock(device);
RestoreFPUMode(&oldMode);
- if(V0(device->Backend,start)() == ALC_FALSE)
- return ALC_INVALID_DEVICE;
- device->Flags |= DEVICE_RUNNING;
+ if(!(device->Flags&DEVICE_PAUSED))
+ {
+ if(V0(device->Backend,start)() == ALC_FALSE)
+ return ALC_INVALID_DEVICE;
+ device->Flags |= DEVICE_RUNNING;
+ }
return ALC_NO_ERROR;
}
@@ -3515,6 +3518,7 @@ ALC_API void ALC_APIENTRY alcDevicePauseSOFT(ALCdevice *device)
if((device->Flags&DEVICE_RUNNING))
V0(device->Backend,stop)();
device->Flags &= ~DEVICE_RUNNING;
+ device->Flags |= DEVICE_PAUSED;
UnlockLists();
}
if(device) ALCdevice_DecRef(device);
@@ -3531,10 +3535,13 @@ ALC_API void ALC_APIENTRY alcDeviceResumeSOFT(ALCdevice *device)
else
{
LockLists();
- if(device->ContextList)
+ if((device->Flags&DEVICE_PAUSED))
{
if(V0(device->Backend,start)() != ALC_FALSE)
+ {
device->Flags |= DEVICE_RUNNING;
+ device->Flags &= ~DEVICE_PAUSED;
+ }
else
{
alcSetError(device, ALC_INVALID_DEVICE);
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 987254fc..3394eab2 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -657,6 +657,9 @@ struct ALCdevice_struct
// Stereo sources cover 120-degree angles around +/-90
#define DEVICE_WIDE_STEREO (1<<16)
+// Specifies if the DSP is paused at user request
+#define DEVICE_PAUSED (1<<30)
+
// Specifies if the device is currently running
#define DEVICE_RUNNING (1<<31)