Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
9a472ba3
Commit
9a472ba3
authored
May 27, 2004
by
Raphael Junqueira
Committed by
Alexandre Julliard
May 27, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- don't use a stupid "while (1);" thread when DMPerformance MSG Queue empty
- try to use latency and MSG synchro for timeout (but as i'm not a sound expert don't expect too much)
parent
d3239b67
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
8 deletions
+26
-8
performance.c
dlls/dmime/performance.c
+26
-8
No files found.
dlls/dmime/performance.c
View file @
9a472ba3
...
...
@@ -50,35 +50,41 @@ struct DMUS_PMSGItem {
#define PROCESSMSG_ADD (WM_APP + 4)
static
void
ProceedMsg
(
IDirectMusicPerformance8Impl
*
This
,
DMUS_PMSGItem
*
cur
)
{
static
DMUS_PMSGItem
*
ProceedMsg
(
IDirectMusicPerformance8Impl
*
This
,
DMUS_PMSGItem
*
cur
)
{
if
(
cur
->
pMsg
.
dwType
==
DMUS_PMSGT_NOTIFICATION
)
{
SetEvent
(
This
->
hNotification
);
}
DMUS_ItemRemoveFromQueue
(
This
,
cur
);
switch
(
cur
->
pMsg
.
dwType
)
{
case
DMUS_PMSGT_WAVE
:
case
DMUS_PMSGT_TEMPO
:
case
DMUS_PMSGT_STOP
:
default:
FIXME
(
"Unhandled PMsg Type: 0x%lx
\n
"
,
cur
->
pMsg
.
dwType
);
break
;
}
HeapFree
(
GetProcessHeap
(),
0
,
cur
);
return
cur
;
}
static
DWORD
WINAPI
ProcessMsgThread
(
LPVOID
lpParam
)
{
IDirectMusicPerformance8Impl
*
This
=
(
IDirectMusicPerformance8Impl
*
)
lpParam
;
/*DWORD timeOut = INFINITE;*/
DWORD
timeOut
=
INFINITE
;
MSG
msg
;
HRESULT
hr
;
REFERENCE_TIME
rtLastTime
;
REFERENCE_TIME
rtCurTime
;
DMUS_PMSGItem
*
it
=
NULL
;
DMUS_PMSGItem
*
cur
=
NULL
;
DMUS_PMSGItem
*
it_next
=
NULL
;
while
(
TRUE
)
{
DWORD
dwDec
=
This
->
rtLatencyTime
+
This
->
dwBumperLength
;
/*if (timeOut > 0) MsgWaitForMultipleObjects(0, NULL, FALSE, timeOut, QS_POSTMESSAGE|QS_SENDMESSAGE|QS_TIMER);*/
if
(
timeOut
>
0
)
MsgWaitForMultipleObjects
(
0
,
NULL
,
FALSE
,
timeOut
,
QS_POSTMESSAGE
|
QS_SENDMESSAGE
|
QS_TIMER
);
timeOut
=
INFINITE
;
EnterCriticalSection
(
&
This
->
safe
);
rtLastTime
=
rtCurTime
;
hr
=
IDirectMusicPerformance8Impl_GetTime
((
IDirectMusicPerformance8
*
)
This
,
&
rtCurTime
,
NULL
);
if
(
FAILED
(
hr
))
{
goto
outrefresh
;
...
...
@@ -86,15 +92,24 @@ static DWORD WINAPI ProcessMsgThread(LPVOID lpParam) {
for
(
it
=
This
->
imm_head
;
NULL
!=
it
;
)
{
it_next
=
it
->
next
;
ProceedMsg
(
This
,
it
);
cur
=
ProceedMsg
(
This
,
it
);
if
(
NULL
!=
cur
)
{
HeapFree
(
GetProcessHeap
(),
0
,
cur
);
}
it
=
it_next
;
}
for
(
it
=
This
->
head
;
NULL
!=
it
&&
it
->
rtItemTime
<
rtCurTime
+
dwDec
;
)
{
it_next
=
it
->
next
;
ProceedMsg
(
This
,
it
);
cur
=
ProceedMsg
(
This
,
it
);
if
(
NULL
!=
cur
)
{
HeapFree
(
GetProcessHeap
(),
0
,
cur
);
}
it
=
it_next
;
}
if
(
NULL
!=
it
)
{
timeOut
=
(
it
->
rtItemTime
-
rtCurTime
)
+
This
->
rtLatencyTime
;
}
outrefresh:
LeaveCriticalSection
(
&
This
->
safe
);
...
...
@@ -122,6 +137,9 @@ outrefresh:
}
}
}
/** here we should run a little of current AudioPath */
}
outofthread:
...
...
@@ -974,7 +992,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicPerformanceImpl (LPCGUID lpcGUID, LPVOID
/**
* @see http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/htm/latencyandbumpertime.asp
*/
obj
->
rtLatencyTime
=
100
0
;
/* 1
s TO FIX */
obj
->
rtLatencyTime
=
100
;
/* 100m
s TO FIX */
obj
->
dwBumperLength
=
50
;
/* 50ms default */
obj
->
dwPrepareTime
=
1000
;
/* 1000ms default */
return
IDirectMusicPerformance8Impl_QueryInterface
((
LPDIRECTMUSICPERFORMANCE8
)
obj
,
lpcGUID
,
ppobj
);
...
...
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