winecoreaudio: Pass a ptr to receive the stream in create_stream.

This matches the other drivers.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2022-04-25 07:58:33 +01:00 committed by Alexandre Julliard
parent 97752f35cf
commit c66d694c4b
3 changed files with 11 additions and 9 deletions

View File

@ -700,7 +700,7 @@ end:
free(stream->fmt);
free(stream);
} else
params->stream = stream;
*params->stream = stream;
return STATUS_SUCCESS;
}

View File

@ -666,6 +666,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface,
ACImpl *This = impl_from_IAudioClient3(iface);
struct release_stream_params release_params;
struct create_stream_params params;
struct coreaudio_stream *stream;
UINT32 i;
TRACE("(%p)->(%x, %x, %s, %s, %p, %s)\n", This, mode, flags,
@ -734,10 +735,13 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface,
params.duration = duration;
params.period = period;
params.fmt = fmt;
params.stream = NULL;
params.stream = &stream;
UNIX_CALL(create_stream, &params);
if(FAILED(params.result)) goto end;
if(FAILED(params.result)){
LeaveCriticalSection(&g_sessions_lock);
return params.result;
}
This->flags = flags;
This->channel_count = fmt->nChannels;
@ -759,14 +763,12 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface,
end:
if(FAILED(params.result)){
if(params.stream){
release_params.stream = params.stream;
UNIX_CALL(release_stream, &release_params);
}
release_params.stream = stream;
UNIX_CALL(release_stream, &release_params);
HeapFree(GetProcessHeap(), 0, This->vols);
This->vols = NULL;
}else{
This->stream = params.stream;
This->stream = stream;
set_stream_volumes(This, -1);
}

View File

@ -46,7 +46,7 @@ struct create_stream_params
REFERENCE_TIME period;
const WAVEFORMATEX *fmt;
HRESULT result;
struct coreaudio_stream *stream;
struct coreaudio_stream **stream;
};
struct release_stream_params