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
7e334a7a
Commit
7e334a7a
authored
Apr 23, 2023
by
Anton Baskanov
Committed by
Alexandre Julliard
Apr 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Allocate big enough committedbuff up front.
parent
13672650
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
13 deletions
+5
-13
buffer.c
dlls/dsound/buffer.c
+3
-12
dsound_private.h
dlls/dsound/dsound_private.h
+1
-1
mixer.c
dlls/dsound/mixer.c
+1
-0
No files found.
dlls/dsound/buffer.c
View file @
7e334a7a
...
...
@@ -264,7 +264,6 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetFrequency(IDirectSoundBuffer8 *i
{
IDirectSoundBufferImpl
*
This
=
impl_from_IDirectSoundBuffer8
(
iface
);
DWORD
oldFreq
;
void
*
newcommitted
;
TRACE
(
"(%p,%ld)
\n
"
,
This
,
freq
);
...
...
@@ -290,17 +289,9 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetFrequency(IDirectSoundBuffer8 *i
oldFreq
=
This
->
freq
;
This
->
freq
=
freq
;
if
(
freq
!=
oldFreq
)
{
if
(
freq
!=
oldFreq
)
DSOUND_RecalcFormat
(
This
);
newcommitted
=
realloc
(
This
->
committedbuff
,
This
->
writelead
);
if
(
!
newcommitted
)
{
ReleaseSRWLockExclusive
(
&
This
->
lock
);
return
DSERR_OUTOFMEMORY
;
}
This
->
committedbuff
=
newcommitted
;
}
ReleaseSRWLockExclusive
(
&
This
->
lock
);
return
DS_OK
;
...
...
@@ -1112,7 +1103,7 @@ HRESULT secondarybuffer_create(DirectSoundDevice *device, const DSBUFFERDESC *ds
/* calculate fragment size and write lead */
DSOUND_RecalcFormat
(
dsb
);
dsb
->
committedbuff
=
malloc
(
dsb
->
writelead
);
dsb
->
committedbuff
=
malloc
(
dsb
->
max
writelead
);
if
(
!
dsb
->
committedbuff
)
{
IDirectSoundBuffer8_Release
(
&
dsb
->
IDirectSoundBuffer8_iface
);
return
DSERR_OUTOFMEMORY
;
...
...
@@ -1216,7 +1207,7 @@ HRESULT IDirectSoundBufferImpl_Duplicate(
return
DSERR_OUTOFMEMORY
;
}
committedbuff
=
malloc
(
pdsb
->
writelead
);
committedbuff
=
malloc
(
pdsb
->
max
writelead
);
if
(
committedbuff
==
NULL
)
{
free
(
dsb
);
*
ppdsb
=
NULL
;
...
...
dlls/dsound/dsound_private.h
View file @
7e334a7a
...
...
@@ -140,7 +140,7 @@ struct IDirectSoundBufferImpl
PWAVEFORMATEX
pwfx
;
BufferMemory
*
buffer
;
DWORD
playflags
,
state
,
leadin
;
DWORD
writelead
,
buflen
;
DWORD
writelead
,
maxwritelead
,
buflen
;
DWORD
freq
;
DSVOLUMEPAN
volpan
;
DSBUFFERDESC
dsbd
;
...
...
dlls/dsound/mixer.c
View file @
7e334a7a
...
...
@@ -130,6 +130,7 @@ void DSOUND_RecalcFormat(IDirectSoundBufferImpl *dsb)
/* calculate the 10ms write lead */
dsb
->
writelead
=
(
dsb
->
freq
/
100
)
*
dsb
->
pwfx
->
nBlockAlign
;
dsb
->
maxwritelead
=
(
DSBFREQUENCY_MAX
/
100
)
*
dsb
->
pwfx
->
nBlockAlign
;
if
(
oldFreqAdjustDen
)
dsb
->
freqAccNum
=
(
dsb
->
freqAccNum
*
dsb
->
freqAdjustDen
+
oldFreqAdjustDen
/
2
)
/
oldFreqAdjustDen
;
...
...
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