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
95287ac2
Commit
95287ac2
authored
May 12, 2016
by
Maarten Lankhorst
Committed by
Alexandre Julliard
May 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Use AudioClient for position.
Signed-off-by:
Andrew Eikum
<
aeikum@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
569ed159
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
23 deletions
+13
-23
dsound_private.h
dlls/dsound/dsound_private.h
+0
-1
primary.c
dlls/dsound/primary.c
+13
-22
No files found.
dlls/dsound/dsound_private.h
View file @
95287ac2
...
...
@@ -75,7 +75,6 @@ struct DirectSoundDevice
DSCAPS
drvcaps
;
DWORD
priolevel
,
sleeptime
;
PWAVEFORMATEX
pwfx
,
primary_pwfx
;
UINT
playing_offs_bytes
,
in_mmdev_bytes
;
LPBYTE
buffer
;
DWORD
writelead
,
buflen
,
aclen
,
fraglen
,
state
,
playpos
,
pad
;
int
nrofbuffers
;
...
...
dlls/dsound/primary.c
View file @
95287ac2
...
...
@@ -480,23 +480,6 @@ HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device)
return
DS_OK
;
}
HRESULT
DSOUND_PrimaryGetPosition
(
DirectSoundDevice
*
device
,
LPDWORD
playpos
,
LPDWORD
writepos
)
{
TRACE
(
"(%p,%p,%p)
\n
"
,
device
,
playpos
,
writepos
);
/* check if playpos was requested */
if
(
playpos
)
*
playpos
=
device
->
playing_offs_bytes
;
/* check if writepos was requested */
if
(
writepos
)
/* the writepos is the first non-queued position */
*
writepos
=
(
device
->
playing_offs_bytes
+
device
->
in_mmdev_bytes
)
%
device
->
buflen
;
TRACE
(
"playpos = %d, writepos = %d (%p, time=%d)
\n
"
,
playpos
?*
playpos
:-
1
,
writepos
?*
writepos
:-
1
,
device
,
GetTickCount
());
return
DS_OK
;
}
WAVEFORMATEX
*
DSOUND_CopyFormat
(
const
WAVEFORMATEX
*
wfex
)
{
WAVEFORMATEX
*
pwfx
;
...
...
@@ -824,7 +807,9 @@ static ULONG WINAPI PrimaryBufferImpl_Release(IDirectSoundBuffer *iface)
static
HRESULT
WINAPI
PrimaryBufferImpl_GetCurrentPosition
(
IDirectSoundBuffer
*
iface
,
DWORD
*
playpos
,
DWORD
*
writepos
)
{
HRESULT
hres
;
HRESULT
hres
=
DS_OK
;
UINT32
pad
=
0
;
UINT32
mixpos
;
IDirectSoundBufferImpl
*
This
=
impl_from_IDirectSoundBuffer
(
iface
);
DirectSoundDevice
*
device
=
This
->
device
;
TRACE
(
"(%p,%p,%p)
\n
"
,
iface
,
playpos
,
writepos
);
...
...
@@ -832,17 +817,23 @@ static HRESULT WINAPI PrimaryBufferImpl_GetCurrentPosition(IDirectSoundBuffer *i
/* **** */
EnterCriticalSection
(
&
(
device
->
mixlock
));
hres
=
DSOUND_PrimaryGetPosition
(
device
,
playpos
,
writepos
);
if
(
device
->
client
)
hres
=
IAudioClient_GetCurrentPadding
(
device
->
client
,
&
pad
);
if
(
hres
!=
DS_OK
)
{
WARN
(
"
DSOUND_PrimaryGetPosition
failed
\n
"
);
WARN
(
"
IAudioClient_GetCurrentPadding
failed
\n
"
);
LeaveCriticalSection
(
&
(
device
->
mixlock
));
return
hres
;
}
mixpos
=
(
device
->
playpos
+
pad
*
device
->
pwfx
->
nBlockAlign
)
%
device
->
buflen
;
if
(
playpos
)
*
playpos
=
mixpos
;
if
(
writepos
)
{
if
(
device
->
state
!=
STATE_STOPPED
)
*
writepos
=
mixpos
;
if
(
device
->
state
!=
STATE_STOPPED
)
{
/* apply the documented 10ms lead to writepos */
*
writepos
+=
device
->
writelead
;
while
(
*
writepos
>=
device
->
buflen
)
*
writepos
-=
device
->
buflen
;
*
writepos
%=
device
->
buflen
;
}
}
LeaveCriticalSection
(
&
(
device
->
mixlock
));
...
...
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