wineoss: Dynamically size the devnode array.
Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
9ff920cdd9
commit
aca2193671
|
@ -121,7 +121,6 @@ struct ACImpl {
|
||||||
|
|
||||||
int fd;
|
int fd;
|
||||||
oss_audioinfo ai;
|
oss_audioinfo ai;
|
||||||
char devnode[OSS_DEVNODE_SIZE];
|
|
||||||
|
|
||||||
BOOL initted, playing;
|
BOOL initted, playing;
|
||||||
UINT64 written_frames, last_pos_frames;
|
UINT64 written_frames, last_pos_frames;
|
||||||
|
@ -138,6 +137,9 @@ struct ACImpl {
|
||||||
AudioSessionWrapper *session_wrapper;
|
AudioSessionWrapper *session_wrapper;
|
||||||
|
|
||||||
struct list entry;
|
struct list entry;
|
||||||
|
|
||||||
|
/* Keep at end */
|
||||||
|
char devnode[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _SessionMgr {
|
typedef struct _SessionMgr {
|
||||||
|
@ -445,6 +447,7 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev,
|
||||||
ACImpl *This;
|
ACImpl *This;
|
||||||
const OSSDevice *oss_dev;
|
const OSSDevice *oss_dev;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
int len;
|
||||||
|
|
||||||
TRACE("%s %p %p\n", debugstr_guid(guid), dev, out);
|
TRACE("%s %p %p\n", debugstr_guid(guid), dev, out);
|
||||||
|
|
||||||
|
@ -453,8 +456,8 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev,
|
||||||
WARN("Unknown GUID: %s\n", debugstr_guid(guid));
|
WARN("Unknown GUID: %s\n", debugstr_guid(guid));
|
||||||
return AUDCLNT_E_DEVICE_INVALIDATED;
|
return AUDCLNT_E_DEVICE_INVALIDATED;
|
||||||
}
|
}
|
||||||
|
len = strlen(oss_dev->devnode);
|
||||||
This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ACImpl));
|
This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, offsetof(ACImpl, devnode[len + 1]));
|
||||||
if(!This)
|
if(!This)
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue