Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
db316c12
Commit
db316c12
authored
May 17, 2016
by
Maarten Lankhorst
Committed by
Alexandre Julliard
May 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Remove unconditional memory allocation in mixing thread.
Signed-off-by:
Andrew Eikum
<
aeikum@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5b0914ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
10 deletions
+19
-10
dsound.c
dlls/dsound/dsound.c
+1
-0
dsound_private.h
dlls/dsound/dsound_private.h
+2
-2
mixer.c
dlls/dsound/mixer.c
+16
-8
No files found.
dlls/dsound/dsound.c
View file @
db316c12
...
@@ -234,6 +234,7 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device)
...
@@ -234,6 +234,7 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device)
IAudioStreamVolume_Release
(
device
->
volume
);
IAudioStreamVolume_Release
(
device
->
volume
);
HeapFree
(
GetProcessHeap
(),
0
,
device
->
tmp_buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
device
->
tmp_buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
device
->
cp_buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
device
->
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
device
->
buffer
);
RtlDeleteResource
(
&
device
->
buffer_list_lock
);
RtlDeleteResource
(
&
device
->
buffer_list_lock
);
device
->
mixlock
.
DebugInfo
->
Spare
[
0
]
=
0
;
device
->
mixlock
.
DebugInfo
->
Spare
[
0
]
=
0
;
...
...
dlls/dsound/dsound_private.h
View file @
db316c12
...
@@ -87,8 +87,8 @@ struct DirectSoundDevice
...
@@ -87,8 +87,8 @@ struct DirectSoundDevice
int
speaker_num
[
DS_MAX_CHANNELS
];
int
speaker_num
[
DS_MAX_CHANNELS
];
int
num_speakers
;
int
num_speakers
;
int
lfe_channel
;
int
lfe_channel
;
float
*
tmp_buffer
;
float
*
tmp_buffer
,
*
cp_buffer
;
DWORD
tmp_buffer_len
;
DWORD
tmp_buffer_len
,
cp_buffer_len
;
DSVOLUMEPAN
volpan
;
DSVOLUMEPAN
volpan
;
...
...
dlls/dsound/mixer.c
View file @
db316c12
...
@@ -292,18 +292,29 @@ static UINT cp_fields_resample(IDirectSoundBufferImpl *dsb, UINT count, LONG64 *
...
@@ -292,18 +292,29 @@ static UINT cp_fields_resample(IDirectSoundBufferImpl *dsb, UINT count, LONG64 *
UINT
fir_cachesize
=
(
fir_len
+
dsbfirstep
-
2
)
/
dsbfirstep
;
UINT
fir_cachesize
=
(
fir_len
+
dsbfirstep
-
2
)
/
dsbfirstep
;
UINT
required_input
=
max_ipos
+
fir_cachesize
;
UINT
required_input
=
max_ipos
+
fir_cachesize
;
float
*
intermediate
,
*
fir_copy
,
*
itmp
;
DWORD
len
=
required_input
*
channels
;
len
+=
fir_cachesize
;
len
*=
sizeof
(
float
);
if
(
!
dsb
->
device
->
cp_buffer
)
{
dsb
->
device
->
cp_buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
dsb
->
device
->
cp_buffer_len
=
len
;
}
else
if
(
len
>
dsb
->
device
->
cp_buffer_len
)
{
dsb
->
device
->
cp_buffer
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
dsb
->
device
->
cp_buffer
,
len
);
dsb
->
device
->
cp_buffer_len
=
len
;
}
f
loat
*
intermediate
=
HeapAlloc
(
GetProcessHeap
(),
0
,
f
ir_copy
=
dsb
->
device
->
cp_buffer
;
sizeof
(
float
)
*
required_input
*
channels
)
;
intermediate
=
fir_copy
+
fir_cachesize
;
float
*
fir_copy
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
float
)
*
fir_cachesize
);
/* Important: this buffer MUST be non-interleaved
/* Important: this buffer MUST be non-interleaved
* if you want -msse3 to have any effect.
* if you want -msse3 to have any effect.
* This is good for CPU cache effects, too.
* This is good for CPU cache effects, too.
*/
*/
float
*
itmp
=
intermediate
;
itmp
=
intermediate
;
for
(
channel
=
0
;
channel
<
channels
;
channel
++
)
for
(
channel
=
0
;
channel
<
channels
;
channel
++
)
for
(
i
=
0
;
i
<
required_input
;
i
++
)
for
(
i
=
0
;
i
<
required_input
;
i
++
)
*
(
itmp
++
)
=
get_current_sample
(
dsb
,
*
(
itmp
++
)
=
get_current_sample
(
dsb
,
...
@@ -338,9 +349,6 @@ static UINT cp_fields_resample(IDirectSoundBufferImpl *dsb, UINT count, LONG64 *
...
@@ -338,9 +349,6 @@ static UINT cp_fields_resample(IDirectSoundBufferImpl *dsb, UINT count, LONG64 *
*
freqAccNum
=
freqAcc_end
%
dsb
->
freqAdjustDen
;
*
freqAccNum
=
freqAcc_end
%
dsb
->
freqAdjustDen
;
HeapFree
(
GetProcessHeap
(),
0
,
fir_copy
);
HeapFree
(
GetProcessHeap
(),
0
,
intermediate
);
return
max_ipos
;
return
max_ipos
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment