Commit 55ed98cb authored by Mark Harmstone's avatar Mark Harmstone Committed by Alexandre Julliard

dsound: Pipe audio data through DMOs.

parent 18b3f4ca
...@@ -293,6 +293,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Play(IDirectSoundBuffer8 *iface, DW ...@@ -293,6 +293,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Play(IDirectSoundBuffer8 *iface, DW
{ {
IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer8(iface); IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer8(iface);
HRESULT hres = DS_OK; HRESULT hres = DS_OK;
int i;
TRACE("(%p,%08x,%08x,%08x)\n",This,reserved1,reserved2,flags); TRACE("(%p,%08x,%08x,%08x)\n",This,reserved1,reserved2,flags);
...@@ -306,6 +307,10 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Play(IDirectSoundBuffer8 *iface, DW ...@@ -306,6 +307,10 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Play(IDirectSoundBuffer8 *iface, DW
} else if (This->state == STATE_STOPPING) } else if (This->state == STATE_STOPPING)
This->state = STATE_PLAYING; This->state = STATE_PLAYING;
for (i = 0; i < This->num_filters; i++) {
IMediaObject_Discontinuity(This->filters[i].obj, 0);
}
RtlReleaseResource(&This->lock); RtlReleaseResource(&This->lock);
/* **** */ /* **** */
......
...@@ -398,6 +398,8 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2) ...@@ -398,6 +398,8 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2)
static void DSOUND_MixToTemporary(IDirectSoundBufferImpl *dsb, DWORD frames) static void DSOUND_MixToTemporary(IDirectSoundBufferImpl *dsb, DWORD frames)
{ {
UINT size_bytes = frames * sizeof(float) * dsb->device->pwfx->nChannels; UINT size_bytes = frames * sizeof(float) * dsb->device->pwfx->nChannels;
HRESULT hr;
int i;
if (dsb->device->tmp_buffer_len < size_bytes || !dsb->device->tmp_buffer) if (dsb->device->tmp_buffer_len < size_bytes || !dsb->device->tmp_buffer)
{ {
...@@ -409,6 +411,18 @@ static void DSOUND_MixToTemporary(IDirectSoundBufferImpl *dsb, DWORD frames) ...@@ -409,6 +411,18 @@ static void DSOUND_MixToTemporary(IDirectSoundBufferImpl *dsb, DWORD frames)
} }
cp_fields(dsb, frames, &dsb->freqAccNum); cp_fields(dsb, frames, &dsb->freqAccNum);
if (size_bytes > 0) {
for (i = 0; i < dsb->num_filters; i++) {
if (dsb->filters[i].inplace) {
hr = IMediaObjectInPlace_Process(dsb->filters[i].inplace, size_bytes, (BYTE*)dsb->device->tmp_buffer, 0, DMO_INPLACE_NORMAL);
if (FAILED(hr))
WARN("IMediaObjectInPlace_Process failed for filter %u\n", i);
} else
WARN("filter %u has no inplace object - unsupported\n", i);
}
}
} }
static void DSOUND_MixerVol(const IDirectSoundBufferImpl *dsb, INT frames) static void DSOUND_MixerVol(const IDirectSoundBufferImpl *dsb, INT frames)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment