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
abe8c127
Commit
abe8c127
authored
Aug 04, 2007
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Aug 06, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Make timer more robust.
parent
3f762d5d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
dsound.c
dlls/dsound/dsound.c
+19
-3
No files found.
dlls/dsound/dsound.c
View file @
abe8c127
...
...
@@ -1514,10 +1514,26 @@ HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGUID lpcG
hr
=
DSOUND_PrimaryCreate
(
device
);
if
(
hr
==
DS_OK
)
{
UINT
triggertime
=
DS_TIME_DEL
,
res
=
DS_TIME_RES
,
id
;
TIMECAPS
time
;
DSOUND_renderer
[
device
->
drvdesc
.
dnDevNode
]
=
device
;
timeBeginPeriod
(
DS_TIME_RES
);
DSOUND_renderer
[
device
->
drvdesc
.
dnDevNode
]
->
timerID
=
timeSetEvent
(
DS_TIME_DEL
,
DS_TIME_RES
,
DSOUND_timer
,
(
DWORD_PTR
)
DSOUND_renderer
[
device
->
drvdesc
.
dnDevNode
],
TIME_PERIODIC
|
TIME_CALLBACK_FUNCTION
|
TIME_KILL_SYNCHRONOUS
);
timeGetDevCaps
(
&
time
,
sizeof
(
TIMECAPS
));
TRACE
(
"Minimum timer resolution: %u, max timer: %u
\n
"
,
time
.
wPeriodMin
,
time
.
wPeriodMax
);
if
(
triggertime
<
time
.
wPeriodMin
)
triggertime
=
time
.
wPeriodMin
;
if
(
res
<
time
.
wPeriodMin
)
res
=
time
.
wPeriodMin
;
if
(
timeBeginPeriod
(
res
)
==
TIMERR_NOCANDO
)
WARN
(
"Could not set minimum resolution, don't expect sound
\n
"
);
id
=
timeSetEvent
(
triggertime
,
res
,
DSOUND_timer
,
(
DWORD_PTR
)
device
,
TIME_PERIODIC
|
TIME_KILL_SYNCHRONOUS
);
if
(
!
id
)
{
WARN
(
"Timer not created! Retrying without TIME_KILL_SYNCHRONOUS
\n
"
);
id
=
timeSetEvent
(
triggertime
,
res
,
DSOUND_timer
,
(
DWORD_PTR
)
device
,
TIME_PERIODIC
);
if
(
!
id
)
ERR
(
"Could not create timer, sound playback will not occur
\n
"
);
}
DSOUND_renderer
[
device
->
drvdesc
.
dnDevNode
]
->
timerID
=
id
;
}
else
{
WARN
(
"DSOUND_PrimaryCreate failed
\n
"
);
}
...
...
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