Module: wine Branch: master Commit: c35745d45adccc37a510dda920887affb7730ce1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=c35745d45adccc37a510dda920...
Author: Michael Stefaniuc mstefani@redhat.de Date: Wed Aug 31 01:19:09 2011 +0200
dsound: Handle primary buffers in two more IDirectSoundBuffer methods.
---
dlls/dsound/buffer.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/dlls/dsound/buffer.c b/dlls/dsound/buffer.c index 7f1d005..6ba6c24 100644 --- a/dlls/dsound/buffer.c +++ b/dlls/dsound/buffer.c @@ -284,6 +284,11 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetFrequency(IDirectSoundBuffer8 *i
TRACE("(%p,%d)\n",This,freq);
+ if (is_primary_buffer(This)) { + WARN("not available for primary buffers.\n"); + return DSERR_CONTROLUNAVAIL; + } + if (!(This->dsbd.dwFlags & DSBCAPS_CTRLFREQUENCY)) { WARN("control unavailable\n"); return DSERR_CONTROLUNAVAIL; @@ -397,9 +402,12 @@ static ULONG WINAPI IDirectSoundBufferImpl_Release(IDirectSoundBuffer8 *iface)
TRACE("(%p) ref was %d\n", This, ref + 1);
- if (!ref && !InterlockedDecrement(&This->numIfaces)) - secondarybuffer_destroy(This); - + if (!ref && !InterlockedDecrement(&This->numIfaces)) { + if (is_primary_buffer(This)) + primarybuffer_destroy(This); + else + secondarybuffer_destroy(This); + } return ref; }