Huw Davies : winepulse: Remove unnecessary alloc_size.
Alexandre Julliard
julliard at winehq.org
Thu Jan 27 15:36:17 CST 2022
Module: wine
Branch: master
Commit: bbd26ea8e5aee2aa4c3e4b4f6beaf53acdfba68d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=bbd26ea8e5aee2aa4c3e4b4f6beaf53acdfba68d
Author: Huw Davies <huw at codeweavers.com>
Date: Wed Jan 26 13:26:12 2022 +0000
winepulse: Remove unnecessary alloc_size.
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/winepulse.drv/pulse.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c
index f32f2a3d26c..3e65936a18f 100644
--- a/dlls/winepulse.drv/pulse.c
+++ b/dlls/winepulse.drv/pulse.c
@@ -59,7 +59,7 @@ struct pulse_stream
INT32 locked;
BOOL started;
- SIZE_T bufsize_frames, alloc_size, real_bufsize_bytes, period_bytes;
+ SIZE_T bufsize_frames, real_bufsize_bytes, period_bytes;
SIZE_T peek_ofs, read_offs_bytes, lcl_offs_bytes, pa_offs_bytes;
SIZE_T tmp_buffer_bytes, held_bytes, peek_len, peek_buffer_len, pa_held_bytes;
BYTE *local_buffer, *tmp_buffer, *peek_buffer;
@@ -868,14 +868,16 @@ static NTSTATUS pulse_create_stream(void *args)
if (SUCCEEDED(hr)) {
UINT32 unalign;
const pa_buffer_attr *attr = pa_stream_get_buffer_attr(stream->stream);
+ SIZE_T size;
+
stream->attr = *attr;
/* Update frames according to new size */
dump_attr(attr);
if (stream->dataflow == eRender) {
- stream->alloc_size = stream->real_bufsize_bytes =
+ size = stream->real_bufsize_bytes =
stream->bufsize_frames * 2 * pa_frame_size(&stream->ss);
if (NtAllocateVirtualMemory(GetCurrentProcess(), (void **)&stream->local_buffer,
- 0, &stream->alloc_size, MEM_COMMIT, PAGE_READWRITE))
+ 0, &size, MEM_COMMIT, PAGE_READWRITE))
hr = E_OUTOFMEMORY;
} else {
UINT32 i, capture_packets;
@@ -887,9 +889,9 @@ static NTSTATUS pulse_create_stream(void *args)
capture_packets = stream->real_bufsize_bytes / stream->period_bytes;
- stream->alloc_size = stream->real_bufsize_bytes + capture_packets * sizeof(ACPacket);
+ size = stream->real_bufsize_bytes + capture_packets * sizeof(ACPacket);
if (NtAllocateVirtualMemory(GetCurrentProcess(), (void **)&stream->local_buffer,
- 0, &stream->alloc_size, MEM_COMMIT, PAGE_READWRITE))
+ 0, &size, MEM_COMMIT, PAGE_READWRITE))
hr = E_OUTOFMEMORY;
else {
ACPacket *cur_packet = (ACPacket*)((char*)stream->local_buffer + stream->real_bufsize_bytes);
More information about the wine-cvs
mailing list