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
ec69d69f
Commit
ec69d69f
authored
Feb 22, 2022
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Feb 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmsynth: Implement the sink GetDesiredBufferSize method.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a0addfe3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
2 deletions
+37
-2
synthsink.c
dlls/dmsynth/synthsink.c
+13
-2
dmsynth.c
dlls/dmsynth/tests/dmsynth.c
+24
-0
No files found.
dlls/dmsynth/synthsink.c
View file @
ec69d69f
...
...
@@ -180,11 +180,22 @@ static HRESULT WINAPI IDirectMusicSynthSinkImpl_SetDirectSound(IDirectMusicSynth
}
static
HRESULT
WINAPI
IDirectMusicSynthSinkImpl_GetDesiredBufferSize
(
IDirectMusicSynthSink
*
iface
,
DWORD
*
buffer_size_in_samples
)
DWORD
*
size
)
{
IDirectMusicSynthSinkImpl
*
This
=
impl_from_IDirectMusicSynthSink
(
iface
);
WAVEFORMATEX
format
;
DWORD
fmtsize
=
sizeof
(
format
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
buffer_size_in_samples
);
TRACE
(
"(%p, %p)
\n
"
,
This
,
size
);
if
(
!
size
)
return
E_POINTER
;
if
(
!
This
->
synth
)
return
DMUS_E_SYNTHNOTCONFIGURED
;
if
(
FAILED
(
IDirectMusicSynth_GetFormat
(
This
->
synth
,
&
format
,
&
fmtsize
)))
return
E_UNEXPECTED
;
*
size
=
format
.
nSamplesPerSec
*
format
.
nChannels
*
4
;
return
S_OK
;
}
...
...
dlls/dmsynth/tests/dmsynth.c
View file @
ec69d69f
...
...
@@ -149,6 +149,8 @@ static void test_dmsynth(void)
/* Synth isn't fully initialized yet */
hr
=
IDirectMusicSynth_Activate
(
dmsynth
,
TRUE
);
ok
(
hr
==
DMUS_E_NOSYNTHSINK
,
"IDirectMusicSynth_Activate returned: %#lx
\n
"
,
hr
);
hr
=
IDirectMusicSynthSink_GetDesiredBufferSize
(
dmsynth_sink
,
&
size
);
ok
(
hr
==
DMUS_E_SYNTHNOTCONFIGURED
,
"IDirectMusicSynthSink_GetDesiredBufferSize returned: %#lx
\n
"
,
hr
);
/* Open / Close */
hr
=
IDirectMusicSynth_Open
(
dmsynth
,
NULL
);
...
...
@@ -274,6 +276,28 @@ static void test_dmsynth(void)
hr
=
IDirectMusicSynth_GetFormat
(
dmsynth
,
&
format
,
&
size
);
ok
(
hr
==
S_OK
,
"GetFormat failed: %#lx
\n
"
,
hr
);
ok
(
size
==
sizeof
(
format
),
"GetFormat size mismatch, got %ld
\n
"
,
size
);
IDirectMusicSynth_Close
(
dmsynth
);
/* GetDesiredBufferSize */
hr
=
IDirectMusicSynthSink_GetDesiredBufferSize
(
dmsynth_sink
,
NULL
);
ok
(
hr
==
E_POINTER
,
"IDirectMusicSynthSink_GetDesiredBufferSize returned: %#lx
\n
"
,
hr
);
hr
=
IDirectMusicSynthSink_GetDesiredBufferSize
(
dmsynth_sink
,
&
size
);
ok
(
hr
==
E_UNEXPECTED
,
"IDirectMusicSynthSink_GetDesiredBufferSize returned: %#lx
\n
"
,
hr
);
params
.
dwValidParams
=
0
;
hr
=
IDirectMusicSynth_Open
(
dmsynth
,
&
params
);
ok
(
hr
==
S_OK
,
"Open failed: %#lx
\n
"
,
hr
);
hr
=
IDirectMusicSynthSink_GetDesiredBufferSize
(
dmsynth_sink
,
&
size
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynthSink_GetDesiredBufferSize returned: %#lx
\n
"
,
hr
);
ok
(
size
==
params
.
dwSampleRate
*
params
.
dwAudioChannels
*
4
,
"size: %ld
\n
"
,
size
);
IDirectMusicSynth_Close
(
dmsynth
);
params
.
dwValidParams
=
DMUS_PORTPARAMS_AUDIOCHANNELS
;
params
.
dwAudioChannels
=
1
;
hr
=
IDirectMusicSynth_Open
(
dmsynth
,
&
params
);
ok
(
hr
==
S_OK
,
"Open failed: %#lx
\n
"
,
hr
);
hr
=
IDirectMusicSynthSink_GetDesiredBufferSize
(
dmsynth_sink
,
&
size
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynthSink_GetDesiredBufferSize returned: %#lx
\n
"
,
hr
);
ok
(
size
==
params
.
dwSampleRate
*
params
.
dwAudioChannels
*
4
,
"size: %ld
\n
"
,
size
);
IDirectMusicSynth_Close
(
dmsynth
);
if
(
control_synth
)
IDirectMusicSynth_Release
(
control_synth
);
...
...
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