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
d407b3ca
Commit
d407b3ca
authored
Sep 14, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime: Rewrite IDirectMusicPerformance8_GetTime.
parent
02ea15b1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
16 deletions
+26
-16
performance.c
dlls/dmime/performance.c
+26
-16
No files found.
dlls/dmime/performance.c
View file @
d407b3ca
...
@@ -60,11 +60,12 @@ struct performance
...
@@ -60,11 +60,12 @@ struct performance
/** Message Processing */
/** Message Processing */
HANDLE
procThread
;
HANDLE
procThread
;
DWORD
procThreadId
;
DWORD
procThreadId
;
REFERENCE_TIME
procThreadStartTime
;
BOOL
procThreadTicStarted
;
BOOL
procThreadTicStarted
;
CRITICAL_SECTION
safe
;
CRITICAL_SECTION
safe
;
struct
DMUS_PMSGItem
*
head
;
struct
DMUS_PMSGItem
*
head
;
struct
DMUS_PMSGItem
*
imm_head
;
struct
DMUS_PMSGItem
*
imm_head
;
IReferenceClock
*
master_clock
;
};
};
typedef
struct
DMUS_PMSGItem
DMUS_PMSGItem
;
typedef
struct
DMUS_PMSGItem
DMUS_PMSGItem
;
...
@@ -476,24 +477,20 @@ static HRESULT WINAPI performance_IsPlaying(IDirectMusicPerformance8 *iface,
...
@@ -476,24 +477,20 @@ static HRESULT WINAPI performance_IsPlaying(IDirectMusicPerformance8 *iface,
return
S_FALSE
;
return
S_FALSE
;
}
}
static
HRESULT
WINAPI
performance_GetTime
(
IDirectMusicPerformance8
*
iface
,
REFERENCE_TIME
*
prtNow
,
MUSIC_TIME
*
pmtNow
)
static
HRESULT
WINAPI
performance_GetTime
(
IDirectMusicPerformance8
*
iface
,
REFERENCE_TIME
*
time
,
MUSIC_TIME
*
music_time
)
{
{
struct
performance
*
This
=
impl_from_IDirectMusicPerformance8
(
iface
);
struct
performance
*
This
=
impl_from_IDirectMusicPerformance8
(
iface
);
HRESULT
hr
=
S_OK
;
REFERENCE_TIME
now
;
REFERENCE_TIME
rtCur
=
0
;
HRESULT
hr
;
TRACE
(
"(%p, %p, %p)
\n
"
,
iface
,
time
,
music_time
);
if
(
!
This
->
master_clock
)
return
DMUS_E_NO_MASTER_CLOCK
;
if
(
FAILED
(
hr
=
IReferenceClock_GetTime
(
This
->
master_clock
,
&
now
)))
return
hr
;
if
(
time
)
*
time
=
now
;
if
(
music_time
)
hr
=
IDirectMusicPerformance8_ReferenceToMusicTime
(
iface
,
now
,
music_time
);
/*TRACE("(%p, %p, %p)\n", This, prtNow, pmtNow); */
if
(
This
->
procThreadTicStarted
)
{
rtCur
=
((
REFERENCE_TIME
)
GetTickCount
()
*
10000
)
-
This
->
procThreadStartTime
;
}
else
{
/*return DMUS_E_NO_MASTER_CLOCK;*/
}
if
(
NULL
!=
prtNow
)
{
*
prtNow
=
rtCur
;
}
if
(
NULL
!=
pmtNow
)
{
hr
=
IDirectMusicPerformance8_ReferenceToMusicTime
(
iface
,
rtCur
,
pmtNow
);
}
return
hr
;
return
hr
;
}
}
...
@@ -873,6 +870,11 @@ static HRESULT WINAPI performance_CloseDown(IDirectMusicPerformance8 *iface)
...
@@ -873,6 +870,11 @@ static HRESULT WINAPI performance_CloseDown(IDirectMusicPerformance8 *iface)
This
->
procThreadTicStarted
=
FALSE
;
This
->
procThreadTicStarted
=
FALSE
;
CloseHandle
(
This
->
procThread
);
CloseHandle
(
This
->
procThread
);
}
}
if
(
This
->
master_clock
)
{
IReferenceClock_Release
(
This
->
master_clock
);
This
->
master_clock
=
NULL
;
}
if
(
This
->
dsound
)
{
if
(
This
->
dsound
)
{
IDirectSound_Release
(
This
->
dsound
);
IDirectSound_Release
(
This
->
dsound
);
This
->
dsound
=
NULL
;
This
->
dsound
=
NULL
;
...
@@ -955,6 +957,9 @@ static HRESULT WINAPI performance_InitAudio(IDirectMusicPerformance8 *iface, IDi
...
@@ -955,6 +957,9 @@ static HRESULT WINAPI performance_InitAudio(IDirectMusicPerformance8 *iface, IDi
IDirectMusic8_AddRef
(
This
->
dmusic
);
IDirectMusic8_AddRef
(
This
->
dmusic
);
}
}
if
(
FAILED
(
hr
=
IDirectMusic_GetMasterClock
(
This
->
dmusic
,
NULL
,
&
This
->
master_clock
)))
goto
error
;
if
(
!
dsound
||
!*
dsound
)
{
if
(
!
dsound
||
!*
dsound
)
{
hr
=
DirectSoundCreate8
(
NULL
,
(
IDirectSound8
**
)
&
This
->
dsound
,
NULL
);
hr
=
DirectSoundCreate8
(
NULL
,
(
IDirectSound8
**
)
&
This
->
dsound
,
NULL
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
...
@@ -1006,6 +1011,11 @@ static HRESULT WINAPI performance_InitAudio(IDirectMusicPerformance8 *iface, IDi
...
@@ -1006,6 +1011,11 @@ static HRESULT WINAPI performance_InitAudio(IDirectMusicPerformance8 *iface, IDi
return
S_OK
;
return
S_OK
;
error:
error:
if
(
This
->
master_clock
)
{
IReferenceClock_Release
(
This
->
master_clock
);
This
->
master_clock
=
NULL
;
}
if
(
This
->
dsound
)
{
if
(
This
->
dsound
)
{
IDirectSound_Release
(
This
->
dsound
);
IDirectSound_Release
(
This
->
dsound
);
This
->
dsound
=
NULL
;
This
->
dsound
=
NULL
;
...
...
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