Commit 8247b00f authored by Davide Beatrici's avatar Davide Beatrici Committed by Alexandre Julliard

winepulse: Move session_init_vols into mmdevapi.

parent 09c7cc1e
......@@ -551,6 +551,27 @@ const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl =
simplevolume_GetMute
};
void session_init_vols(struct audio_session *session, UINT channels)
{
if (session->channel_count < channels) {
UINT i;
if (session->channel_vols)
session->channel_vols = HeapReAlloc(GetProcessHeap(), 0, session->channel_vols,
sizeof(float) * channels);
else
session->channel_vols = HeapAlloc(GetProcessHeap(), 0, sizeof(float) * channels);
if (!session->channel_vols)
return;
for (i = session->channel_count; i < channels; i++)
session->channel_vols[i] = 1.f;
session->channel_count = channels;
}
}
struct audio_session_wrapper *session_wrapper_create(struct audio_client *client)
{
struct audio_session_wrapper *ret;
......
......@@ -399,26 +399,7 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient
return S_OK;
}
static void session_init_vols(AudioSession *session, UINT channels)
{
if (session->channel_count < channels) {
UINT i;
if (session->channel_vols)
session->channel_vols = HeapReAlloc(GetProcessHeap(), 0,
session->channel_vols, sizeof(float) * channels);
else
session->channel_vols = HeapAlloc(GetProcessHeap(), 0,
sizeof(float) * channels);
if (!session->channel_vols)
return;
for(i = session->channel_count; i < channels; ++i)
session->channel_vols[i] = 1.f;
session->channel_count = channels;
}
}
extern void session_init_vols(AudioSession *session, UINT channels);
static AudioSession *create_session(const GUID *guid, IMMDevice *device,
UINT num_channels)
......
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