mf/sar: Use MF_AUDIO_RENDERER_ATTRIBUTE_SESSION_ID to initialize audio client.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-05-14 01:52:07 +03:00 committed by Alexandre Julliard
parent d3b3b2f4b9
commit 5f5549f154
1 changed files with 6 additions and 1 deletions

View File

@ -98,6 +98,7 @@ struct audio_renderer
struct struct
{ {
unsigned int flags; unsigned int flags;
GUID session_id;
} stream_config; } stream_config;
HANDLE buffer_ready_event; HANDLE buffer_ready_event;
MFWORKITEM_KEY buffer_ready_key; MFWORKITEM_KEY buffer_ready_key;
@ -1176,7 +1177,10 @@ static HRESULT sar_create_mmdevice(IMFAttributes *attributes, struct audio_rende
/* Configuration attributes to be used later for audio client initialization. */ /* Configuration attributes to be used later for audio client initialization. */
if (attributes) if (attributes)
{
IMFAttributes_GetUINT32(attributes, &MF_AUDIO_RENDERER_ATTRIBUTE_FLAGS, &renderer->stream_config.flags); IMFAttributes_GetUINT32(attributes, &MF_AUDIO_RENDERER_ATTRIBUTE_FLAGS, &renderer->stream_config.flags);
IMFAttributes_GetGUID(attributes, &MF_AUDIO_RENDERER_ATTRIBUTE_SESSION_ID, &renderer->stream_config.session_id);
}
if (FAILED(hr)) if (FAILED(hr))
hr = MF_E_NO_AUDIO_PLAYBACK_DEVICE; hr = MF_E_NO_AUDIO_PLAYBACK_DEVICE;
@ -1539,7 +1543,8 @@ static HRESULT audio_renderer_create_audio_client(struct audio_renderer *rendere
flags |= AUDCLNT_STREAMFLAGS_CROSSPROCESS; flags |= AUDCLNT_STREAMFLAGS_CROSSPROCESS;
if (renderer->stream_config.flags & MF_AUDIO_RENDERER_ATTRIBUTE_FLAGS_NOPERSIST) if (renderer->stream_config.flags & MF_AUDIO_RENDERER_ATTRIBUTE_FLAGS_NOPERSIST)
flags |= AUDCLNT_STREAMFLAGS_NOPERSIST; flags |= AUDCLNT_STREAMFLAGS_NOPERSIST;
hr = IAudioClient_Initialize(renderer->audio_client, AUDCLNT_SHAREMODE_SHARED, flags, 1000000, 0, wfx, NULL); hr = IAudioClient_Initialize(renderer->audio_client, AUDCLNT_SHAREMODE_SHARED, flags, 1000000, 0, wfx,
&renderer->stream_config.session_id);
CoTaskMemFree(wfx); CoTaskMemFree(wfx);
if (FAILED(hr)) if (FAILED(hr))
{ {