Huw Davies : wineoss: Explicitly store the channel count in the client.
Alexandre Julliard
julliard at winehq.org
Mon Apr 11 15:55:00 CDT 2022
Module: wine
Branch: master
Commit: 9ff920cdd9b4bb07eb0c7f5f8f33c21a3a644eac
URL: https://source.winehq.org/git/wine.git/?a=commit;h=9ff920cdd9b4bb07eb0c7f5f8f33c21a3a644eac
Author: Huw Davies <huw at codeweavers.com>
Date: Wed Apr 6 07:55:51 2022 +0100
wineoss: Explicitly store the channel count in the client.
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wineoss.drv/mmdevdrv.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c
index fd35a439c5a..5b6addef0f7 100644
--- a/dlls/wineoss.drv/mmdevdrv.c
+++ b/dlls/wineoss.drv/mmdevdrv.c
@@ -117,6 +117,7 @@ struct ACImpl {
AUDCLNT_SHAREMODE share;
HANDLE event;
float *vols;
+ UINT32 channel_count;
int fd;
oss_audioinfo ai;
@@ -970,7 +971,8 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface,
return E_OUTOFMEMORY;
}
- This->vols = HeapAlloc(GetProcessHeap(), 0, fmt->nChannels * sizeof(float));
+ This->channel_count = fmt->nChannels;
+ This->vols = HeapAlloc(GetProcessHeap(), 0, This->channel_count * sizeof(float));
if(!This->vols){
CoTaskMemFree(This->fmt);
This->fmt = NULL;
@@ -979,14 +981,14 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface,
return E_OUTOFMEMORY;
}
- for(i = 0; i < fmt->nChannels; ++i)
+ for(i = 0; i < This->channel_count; ++i)
This->vols[i] = 1.f;
This->share = mode;
This->flags = flags;
This->oss_bufsize_bytes = 0;
- hr = get_audio_session(sessionguid, This->parent, fmt->nChannels,
+ hr = get_audio_session(sessionguid, This->parent, This->channel_count,
&This->session);
if(FAILED(hr)){
HeapFree(GetProcessHeap(), 0, This->vols);
@@ -2674,7 +2676,7 @@ static HRESULT WINAPI AudioStreamVolume_GetChannelCount(
if(!out)
return E_POINTER;
- *out = This->fmt->nChannels;
+ *out = This->channel_count;
return S_OK;
}
@@ -2689,7 +2691,7 @@ static HRESULT WINAPI AudioStreamVolume_SetChannelVolume(
if(level < 0.f || level > 1.f)
return E_INVALIDARG;
- if(index >= This->fmt->nChannels)
+ if(index >= This->channel_count)
return E_INVALIDARG;
EnterCriticalSection(&This->lock);
@@ -2713,7 +2715,7 @@ static HRESULT WINAPI AudioStreamVolume_GetChannelVolume(
if(!level)
return E_POINTER;
- if(index >= This->fmt->nChannels)
+ if(index >= This->channel_count)
return E_INVALIDARG;
*level = This->vols[index];
@@ -2732,7 +2734,7 @@ static HRESULT WINAPI AudioStreamVolume_SetAllVolumes(
if(!levels)
return E_POINTER;
- if(count != This->fmt->nChannels)
+ if(count != This->channel_count)
return E_INVALIDARG;
EnterCriticalSection(&This->lock);
@@ -2758,7 +2760,7 @@ static HRESULT WINAPI AudioStreamVolume_GetAllVolumes(
if(!levels)
return E_POINTER;
- if(count != This->fmt->nChannels)
+ if(count != This->channel_count)
return E_INVALIDARG;
EnterCriticalSection(&This->lock);
More information about the wine-cvs
mailing list