winealsa: Use the stream ptr to indicate the init state.
Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1ad8978f40
commit
10987172f4
|
@ -109,8 +109,6 @@ struct ACImpl {
|
|||
UINT32 channel_count;
|
||||
struct alsa_stream *stream;
|
||||
|
||||
BOOL initted;
|
||||
|
||||
HANDLE timer;
|
||||
|
||||
CRITICAL_SECTION lock;
|
||||
|
@ -578,7 +576,7 @@ static ULONG WINAPI AudioClient_Release(IAudioClient3 *iface)
|
|||
IUnknown_Release(This->pUnkFTMarshal);
|
||||
This->lock.DebugInfo->Spare[0] = 0;
|
||||
DeleteCriticalSection(&This->lock);
|
||||
if(This->initted){
|
||||
if(This->session){
|
||||
EnterCriticalSection(&g_sessions_lock);
|
||||
list_remove(&This->entry);
|
||||
LeaveCriticalSection(&g_sessions_lock);
|
||||
|
@ -969,7 +967,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface,
|
|||
EnterCriticalSection(&g_sessions_lock);
|
||||
EnterCriticalSection(&This->lock);
|
||||
|
||||
if(This->initted){
|
||||
if(This->stream){
|
||||
LeaveCriticalSection(&This->lock);
|
||||
LeaveCriticalSection(&g_sessions_lock);
|
||||
return AUDCLNT_E_ALREADY_INITIALIZED;
|
||||
|
@ -1201,7 +1199,6 @@ exit:
|
|||
This->vols = NULL;
|
||||
}else{
|
||||
This->stream = stream;
|
||||
This->initted = TRUE;
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&This->lock);
|
||||
|
@ -1223,7 +1220,7 @@ static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient3 *iface,
|
|||
|
||||
EnterCriticalSection(&This->lock);
|
||||
|
||||
if(!This->initted){
|
||||
if(!This->stream){
|
||||
LeaveCriticalSection(&This->lock);
|
||||
return AUDCLNT_E_NOT_INITIALIZED;
|
||||
}
|
||||
|
@ -1248,7 +1245,7 @@ static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient3 *iface,
|
|||
|
||||
EnterCriticalSection(&This->lock);
|
||||
|
||||
if(!This->initted){
|
||||
if(!This->stream){
|
||||
LeaveCriticalSection(&This->lock);
|
||||
return AUDCLNT_E_NOT_INITIALIZED;
|
||||
}
|
||||
|
@ -1282,7 +1279,7 @@ static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient3 *iface,
|
|||
|
||||
EnterCriticalSection(&This->lock);
|
||||
|
||||
if(!This->initted){
|
||||
if(!This->stream){
|
||||
LeaveCriticalSection(&This->lock);
|
||||
return AUDCLNT_E_NOT_INITIALIZED;
|
||||
}
|
||||
|
@ -1873,7 +1870,7 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient3 *iface)
|
|||
|
||||
EnterCriticalSection(&This->lock);
|
||||
|
||||
if(!This->initted){
|
||||
if(!This->stream){
|
||||
LeaveCriticalSection(&This->lock);
|
||||
return AUDCLNT_E_NOT_INITIALIZED;
|
||||
}
|
||||
|
@ -1942,7 +1939,7 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient3 *iface)
|
|||
|
||||
EnterCriticalSection(&This->lock);
|
||||
|
||||
if(!This->initted){
|
||||
if(!This->stream){
|
||||
LeaveCriticalSection(&This->lock);
|
||||
return AUDCLNT_E_NOT_INITIALIZED;
|
||||
}
|
||||
|
@ -1971,7 +1968,7 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient3 *iface)
|
|||
|
||||
EnterCriticalSection(&This->lock);
|
||||
|
||||
if(!This->initted){
|
||||
if(!This->stream){
|
||||
LeaveCriticalSection(&This->lock);
|
||||
return AUDCLNT_E_NOT_INITIALIZED;
|
||||
}
|
||||
|
@ -2023,7 +2020,7 @@ static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient3 *iface,
|
|||
|
||||
EnterCriticalSection(&This->lock);
|
||||
|
||||
if(!This->initted){
|
||||
if(!This->stream){
|
||||
LeaveCriticalSection(&This->lock);
|
||||
return AUDCLNT_E_NOT_INITIALIZED;
|
||||
}
|
||||
|
@ -2059,7 +2056,7 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient3 *iface, REFIID riid,
|
|||
|
||||
EnterCriticalSection(&This->lock);
|
||||
|
||||
if(!This->initted){
|
||||
if(!This->stream){
|
||||
LeaveCriticalSection(&This->lock);
|
||||
return AUDCLNT_E_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue