Andrew Eikum : winecoreaudio.drv: Store the PropertyScope in ACImpl.
Alexandre Julliard
julliard at winehq.org
Mon May 9 13:34:45 CDT 2011
Module: wine
Branch: master
Commit: b9a66b1bc364c316249a4c11e5499c1c5c29e7a7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b9a66b1bc364c316249a4c11e5499c1c5c29e7a7
Author: Andrew Eikum <aeikum at codeweavers.com>
Date: Fri May 6 10:34:31 2011 -0500
winecoreaudio.drv: Store the PropertyScope in ACImpl.
---
dlls/winecoreaudio.drv/mmdevdrv.c | 35 +++++++++++++----------------------
1 files changed, 13 insertions(+), 22 deletions(-)
diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c
index 503b983..d5c064d 100644
--- a/dlls/winecoreaudio.drv/mmdevdrv.c
+++ b/dlls/winecoreaudio.drv/mmdevdrv.c
@@ -112,6 +112,7 @@ struct ACImpl {
AudioDeviceID adevid;
AudioQueueRef aqueue;
+ AudioObjectPropertyScope scope;
HANDLE timer;
UINT32 period_ms, bufsize_frames, inbuf_frames, written_frames;
UINT64 last_time;
@@ -402,6 +403,15 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(AudioDeviceID *adevid, IMMDevice *dev,
This->dataflow = dataflow;
+ if(dataflow == eRender)
+ This->scope = kAudioDevicePropertyScopeOutput;
+ else if(dataflow == eCapture)
+ This->scope = kAudioDevicePropertyScopeInput;
+ else{
+ HeapFree(GetProcessHeap(), 0, This);
+ return E_INVALIDARG;
+ }
+
This->lock = 0;
This->parent = dev;
@@ -872,12 +882,7 @@ static HRESULT ca_get_max_stream_latency(ACImpl *This, UInt32 *max)
OSStatus sc;
int nstreams, i;
- if(This->dataflow == eRender)
- addr.mScope = kAudioDevicePropertyScopeOutput;
- else if(This->dataflow == eCapture)
- addr.mScope = kAudioDevicePropertyScopeInput;
- else
- return E_UNEXPECTED;
+ addr.mScope = This->scope;
addr.mElement = 0;
addr.mSelector = kAudioDevicePropertyStreams;
@@ -944,14 +949,7 @@ static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient *iface,
return AUDCLNT_E_NOT_INITIALIZED;
}
- if(This->dataflow == eRender)
- addr.mScope = kAudioDevicePropertyScopeOutput;
- else if(This->dataflow == eCapture)
- addr.mScope = kAudioDevicePropertyScopeInput;
- else{
- OSSpinLockUnlock(&This->lock);
- return E_UNEXPECTED;
- }
+ addr.mScope = This->scope;
addr.mSelector = kAudioDevicePropertyLatency;
addr.mElement = 0;
@@ -1077,14 +1075,7 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
fmt->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
- if(This->dataflow == eRender)
- addr.mScope = kAudioDevicePropertyScopeOutput;
- else if(This->dataflow == eCapture)
- addr.mScope = kAudioDevicePropertyScopeInput;
- else{
- OSSpinLockUnlock(&This->lock);
- return E_UNEXPECTED;
- }
+ addr.mScope = This->scope;
addr.mElement = 0;
addr.mSelector = kAudioDevicePropertyStreamConfiguration;
More information about the wine-cvs
mailing list