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
6c73c316
Commit
6c73c316
authored
Jan 19, 2022
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jan 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmsynth: Disconnect old sink, addref and init new sink.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
00eaccda
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
6 deletions
+27
-6
synth.c
dlls/dmsynth/synth.c
+17
-4
dmsynth.c
dlls/dmsynth/tests/dmsynth.c
+10
-2
No files found.
dlls/dmsynth/synth.c
View file @
6c73c316
...
...
@@ -362,15 +362,28 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_SetSynthSink(IDirectMusicSynth8 *if
IDirectMusicSynthSink
*
sink
)
{
IDirectMusicSynth8Impl
*
This
=
impl_from_IDirectMusicSynth8
(
iface
);
HRESULT
hr
;
TRACE
(
"(%p)->(%p)
\n
"
,
iface
,
sink
);
This
->
sink
=
sink
;
if
(
sink
==
This
->
sink
)
return
S_OK
;
if
(
!
sink
||
This
->
sink
)
{
/* Disconnect the sink */
if
(
This
->
latency_clock
)
IReferenceClock_Release
(
This
->
latency_clock
);
IDirectMusicSynthSink_Release
(
This
->
sink
);
}
if
(
sink
)
return
IDirectMusicSynthSink_GetLatencyClock
(
sink
,
&
This
->
latency_clock
);
This
->
sink
=
sink
;
if
(
!
sink
)
return
S_OK
;
return
S_OK
;
IDirectMusicSynthSink_AddRef
(
This
->
sink
);
if
(
FAILED
(
hr
=
IDirectMusicSynthSink_Init
(
sink
,
(
IDirectMusicSynth
*
)
iface
)))
return
hr
;
return
IDirectMusicSynthSink_GetLatencyClock
(
sink
,
&
This
->
latency_clock
);
}
static
HRESULT
WINAPI
IDirectMusicSynth8Impl_Render
(
IDirectMusicSynth8
*
iface
,
short
*
buffer
,
...
...
dlls/dmsynth/tests/dmsynth.c
View file @
6c73c316
...
...
@@ -54,7 +54,7 @@ static ULONG get_refcount(void *iface)
static
void
test_dmsynth
(
void
)
{
IDirectMusicSynth
*
dmsynth
=
NULL
;
IDirectMusicSynthSink
*
dmsynth_sink
=
NULL
;
IDirectMusicSynthSink
*
dmsynth_sink
=
NULL
,
*
dmsynth_sink2
=
NULL
;
IReferenceClock
*
clock_synth
=
NULL
;
IReferenceClock
*
clock_sink
=
NULL
;
IKsControl
*
control_synth
=
NULL
;
...
...
@@ -68,7 +68,11 @@ static void test_dmsynth(void)
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSynth
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicSynth
,
(
LPVOID
*
)
&
dmsynth
);
ok
(
hr
==
S_OK
,
"CoCreateInstance returned: %x
\n
"
,
hr
);
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSynthSink
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicSynthSink
,
(
LPVOID
*
)
&
dmsynth_sink
);
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSynthSink
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicSynthSink
,
(
void
**
)
&
dmsynth_sink
);
ok
(
hr
==
S_OK
,
"CoCreateInstance returned: %x
\n
"
,
hr
);
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSynthSink
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicSynthSink
,
(
void
**
)
&
dmsynth_sink2
);
ok
(
hr
==
S_OK
,
"CoCreateInstance returned: %x
\n
"
,
hr
);
hr
=
IDirectMusicSynth_QueryInterface
(
dmsynth
,
&
IID_IKsControl
,
(
LPVOID
*
)
&
control_synth
);
...
...
@@ -127,6 +131,8 @@ static void test_dmsynth(void)
ref_clock_sink
=
get_refcount
(
clock_sink
);
/* This will Init() the SynthSink and finish initializing the Synth */
hr
=
IDirectMusicSynth_SetSynthSink
(
dmsynth
,
dmsynth_sink2
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynth_SetSynthSink returned: %x
\n
"
,
hr
);
hr
=
IDirectMusicSynth_SetSynthSink
(
dmsynth
,
dmsynth_sink
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynth_SetSynthSink returned: %x
\n
"
,
hr
);
...
...
@@ -148,6 +154,8 @@ static void test_dmsynth(void)
IReferenceClock_Release
(
clock_sink
);
if
(
dmsynth_sink
)
IDirectMusicSynthSink_Release
(
dmsynth_sink
);
if
(
dmsynth_sink2
)
IDirectMusicSynthSink_Release
(
dmsynth_sink2
);
IDirectMusicSynth_Release
(
dmsynth
);
}
...
...
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