Commit 4432b66e authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

winepulse: Simplify IAudioStreamVolume::GetChannelVolume implementation.

parent 6a629656
......@@ -1494,21 +1494,21 @@ static HRESULT WINAPI AudioStreamVolume_GetChannelVolume(
IAudioStreamVolume *iface, UINT32 index, float *level)
{
ACImpl *This = impl_from_IAudioStreamVolume(iface);
float volumes[PA_CHANNELS_MAX];
HRESULT hr;
TRACE("(%p)->(%d, %p)\n", This, index, level);
if (!level)
return E_POINTER;
if (!This->pulse_stream)
return AUDCLNT_E_NOT_INITIALIZED;
if (index >= This->channel_count)
return E_INVALIDARG;
hr = AudioStreamVolume_GetAllVolumes(iface, This->channel_count, volumes);
if (SUCCEEDED(hr))
*level = volumes[index];
return hr;
pulse->lock();
*level = This->vol[index];
pulse->unlock();
return S_OK;
}
static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl =
......
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