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
e6ae7335
Commit
e6ae7335
authored
Mar 03, 2015
by
Mark Harmstone
Committed by
Alexandre Julliard
Mar 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Keep track of locked bytes.
parent
fc324d97
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
buffer.c
dlls/dsound/buffer.c
+16
-1
dsound_private.h
dlls/dsound/dsound_private.h
+1
-0
No files found.
dlls/dsound/buffer.c
View file @
e6ae7335
...
...
@@ -519,16 +519,20 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Lock(IDirectSoundBuffer8 *iface, DW
TRACE
(
"Locked %p(%i bytes) and %p(%i bytes) writecursor=%d
\n
"
,
*
(
LPBYTE
*
)
lplpaudioptr1
,
*
audiobytes1
,
lplpaudioptr2
?
*
(
LPBYTE
*
)
lplpaudioptr2
:
NULL
,
audiobytes2
?
*
audiobytes2
:
0
,
writecursor
);
TRACE
(
"->%d.0
\n
"
,
writebytes
);
This
->
buffer
->
lockedbytes
+=
writebytes
;
}
else
{
DWORD
remainder
=
writebytes
+
writecursor
-
This
->
buflen
;
*
(
LPBYTE
*
)
lplpaudioptr1
=
This
->
buffer
->
memory
+
writecursor
;
*
audiobytes1
=
This
->
buflen
-
writecursor
;
This
->
buffer
->
lockedbytes
+=
*
audiobytes1
;
if
(
This
->
sec_mixpos
>=
writecursor
&&
This
->
sec_mixpos
<
writecursor
+
writebytes
&&
This
->
state
==
STATE_PLAYING
)
WARN
(
"Overwriting mixing position, case 2
\n
"
);
if
(
lplpaudioptr2
)
*
(
LPBYTE
*
)
lplpaudioptr2
=
This
->
buffer
->
memory
;
if
(
audiobytes2
)
if
(
audiobytes2
)
{
*
audiobytes2
=
writebytes
-
(
This
->
buflen
-
writecursor
);
This
->
buffer
->
lockedbytes
+=
*
audiobytes2
;
}
if
(
audiobytes2
&&
This
->
sec_mixpos
<
remainder
&&
This
->
state
==
STATE_PLAYING
)
WARN
(
"Overwriting mixing position, case 3
\n
"
);
TRACE
(
"Locked %p(%i bytes) and %p(%i bytes) writecursor=%d
\n
"
,
*
(
LPBYTE
*
)
lplpaudioptr1
,
*
audiobytes1
,
lplpaudioptr2
?
*
(
LPBYTE
*
)
lplpaudioptr2
:
NULL
,
audiobytes2
?
*
audiobytes2
:
0
,
writecursor
);
...
...
@@ -644,7 +648,17 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Unlock(IDirectSoundBuffer8 *iface,
{
if
(
x1
+
(
DWORD_PTR
)
p1
-
(
DWORD_PTR
)
iter
->
buffer
->
memory
>
iter
->
buflen
)
hres
=
DSERR_INVALIDPARAM
;
else
iter
->
buffer
->
lockedbytes
-=
x1
;
}
if
(
x2
)
{
if
(
x2
+
(
DWORD_PTR
)
p2
-
(
DWORD_PTR
)
iter
->
buffer
->
memory
>
iter
->
buflen
)
hres
=
DSERR_INVALIDPARAM
;
else
iter
->
buffer
->
lockedbytes
-=
x2
;
}
RtlReleaseResource
(
&
iter
->
lock
);
}
RtlReleaseResource
(
&
This
->
device
->
buffer_list_lock
);
...
...
@@ -927,6 +941,7 @@ HRESULT IDirectSoundBufferImpl_Create(
}
dsb
->
buffer
->
ref
=
1
;
dsb
->
buffer
->
lockedbytes
=
0
;
list_init
(
&
dsb
->
buffer
->
buffers
);
list_add_head
(
&
dsb
->
buffer
->
buffers
,
&
dsb
->
entry
);
FillMemory
(
dsb
->
buffer
->
memory
,
dsb
->
buflen
,
dsbd
->
lpwfxFormat
->
wBitsPerSample
==
8
?
128
:
0
);
...
...
dlls/dsound/dsound_private.h
View file @
e6ae7335
...
...
@@ -107,6 +107,7 @@ struct DirectSoundDevice
typedef
struct
BufferMemory
{
LONG
ref
;
LONG
lockedbytes
;
LPBYTE
memory
;
struct
list
buffers
;
}
BufferMemory
;
...
...
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