aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/dsound.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-08-13 12:28:46 -0700
committerChris Robinson <[email protected]>2009-08-13 12:28:46 -0700
commit243939f94f26b1840255590b2454e931374de73f (patch)
tree2739c389486d703c5d31ab262aecb1be02d11b5c /Alc/dsound.c
parent739385bd89c4eaae662ee1e017f74ba0da31f350 (diff)
Allow delaying playback start until context creation, and don't use UpdateSize to store the buffer size
This will make it possible to support the context attributes (frequency, refresh, etc) for some backends
Diffstat (limited to 'Alc/dsound.c')
-rw-r--r--Alc/dsound.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/Alc/dsound.c b/Alc/dsound.c
index 2329a4d7..92ee8073 100644
--- a/Alc/dsound.c
+++ b/Alc/dsound.c
@@ -309,7 +309,7 @@ static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceNam
memset(&DSBDescription,0,sizeof(DSBUFFERDESC));
DSBDescription.dwSize=sizeof(DSBUFFERDESC);
DSBDescription.dwFlags=DSBCAPS_GLOBALFOCUS|DSBCAPS_GETCURRENTPOSITION2;
- DSBDescription.dwBufferBytes=(device->UpdateSize/num_frags) * num_frags * frameSize;
+ DSBDescription.dwBufferBytes=(device->BufferSize/num_frags) * num_frags * frameSize;
DSBDescription.lpwfxFormat=&OutputType.Format;
hr = IDirectSound_CreateSoundBuffer(pData->lpDS, &DSBDescription, &pData->DSsbuffer, NULL);
}
@@ -339,7 +339,7 @@ static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceNam
}
device->Format = format;
- device->UpdateSize /= num_frags;
+ device->UpdateSize = device->BufferSize/num_frags;
return ALC_TRUE;
}
@@ -360,6 +360,19 @@ static void DSoundClosePlayback(ALCdevice *device)
device->ExtraData = NULL;
}
+static ALCboolean DSoundStartContext(ALCdevice *device, ALCcontext *context)
+{
+ return ALC_TRUE;
+ (void)device;
+ (void)context;
+}
+
+static void DSoundStopContext(ALCdevice *device, ALCcontext *context)
+{
+ (void)device;
+ (void)context;
+}
+
static ALCboolean DSoundOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName, ALCuint frequency, ALCenum format, ALCsizei SampleSize)
{
@@ -403,6 +416,8 @@ static ALCuint DSoundAvailableSamples(ALCdevice *pDevice)
BackendFuncs DSoundFuncs = {
DSoundOpenPlayback,
DSoundClosePlayback,
+ DSoundStartContext,
+ DSoundStopContext,
DSoundOpenCapture,
DSoundCloseCapture,
DSoundStartCapture,