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
2c628af7
Commit
2c628af7
authored
Jan 25, 2012
by
Andrew Eikum
Committed by
Alexandre Julliard
Jan 25, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineoss.drv: Use GETODELAY instead of GETOSPACE to determine device position.
parent
92e83511
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
11 deletions
+32
-11
mmdevdrv.c
dlls/wineoss.drv/mmdevdrv.c
+32
-11
No files found.
dlls/wineoss.drv/mmdevdrv.c
View file @
2c628af7
...
...
@@ -115,7 +115,7 @@ struct ACImpl {
char
devnode
[
OSS_DEVNODE_SIZE
];
BOOL
initted
,
playing
;
UINT64
written_frames
;
UINT64
written_frames
,
last_pos_frames
;
UINT32
period_us
,
period_frames
,
bufsize_frames
,
held_frames
,
tmp_buffer_frames
;
UINT32
oss_bufsize_bytes
,
lcl_offs_frames
;
/* offs into local_buffer where valid data starts */
...
...
@@ -1454,6 +1454,7 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
}
This
->
lcl_offs_frames
=
0
;
This
->
held_frames
=
0
;
This
->
last_pos_frames
=
0
;
LeaveCriticalSection
(
&
This
->
lock
);
...
...
@@ -1953,8 +1954,7 @@ static HRESULT WINAPI AudioClock_GetPosition(IAudioClock *iface, UINT64 *pos,
UINT64
*
qpctime
)
{
ACImpl
*
This
=
impl_from_IAudioClock
(
iface
);
UINT32
pad
;
HRESULT
hr
;
int
delay
;
TRACE
(
"(%p)->(%p, %p)
\n
"
,
This
,
pos
,
qpctime
);
...
...
@@ -1963,16 +1963,37 @@ static HRESULT WINAPI AudioClock_GetPosition(IAudioClock *iface, UINT64 *pos,
EnterCriticalSection
(
&
This
->
lock
);
hr
=
IAudioClient_GetCurrentPadding
(
&
This
->
IAudioClient_iface
,
&
pad
);
if
(
FAILED
(
hr
)){
LeaveCriticalSection
(
&
This
->
lock
);
return
hr
;
if
(
This
->
dataflow
==
eRender
){
if
(
!
This
->
playing
||
!
This
->
held_frames
||
ioctl
(
This
->
fd
,
SNDCTL_DSP_GETODELAY
,
&
delay
)
<
0
)
delay
=
0
;
else
delay
/=
This
->
fmt
->
nBlockAlign
;
if
(
This
->
held_frames
+
delay
>=
This
->
written_frames
)
*
pos
=
This
->
last_pos_frames
;
else
{
*
pos
=
This
->
written_frames
-
This
->
held_frames
-
delay
;
if
(
*
pos
<
This
->
last_pos_frames
)
*
pos
=
This
->
last_pos_frames
;
}
}
else
if
(
This
->
dataflow
==
eCapture
){
audio_buf_info
bi
;
UINT32
held
;
if
(
ioctl
(
This
->
fd
,
SNDCTL_DSP_GETISPACE
,
&
bi
)
<
0
){
TRACE
(
"GETISPACE failed: %d (%s)
\n
"
,
errno
,
strerror
(
errno
));
held
=
0
;
}
else
{
if
(
bi
.
bytes
<=
bi
.
fragsize
)
held
=
0
;
else
held
=
bi
.
bytes
/
This
->
fmt
->
nBlockAlign
;
}
*
pos
=
This
->
written_frames
+
held
;
}
if
(
This
->
dataflow
==
eRender
)
*
pos
=
This
->
written_frames
-
pad
;
else
if
(
This
->
dataflow
==
eCapture
)
*
pos
=
This
->
written_frames
+
pad
;
This
->
last_pos_frames
=
*
pos
;
LeaveCriticalSection
(
&
This
->
lock
);
...
...
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