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
66a58ad5
Commit
66a58ad5
authored
Aug 28, 2015
by
Andrew Eikum
Committed by
Alexandre Julliard
Aug 29, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xaudio2: Implement IXAudio2SourceVoice::FlushSourceBuffers.
parent
cb382428
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
xaudio_dll.c
dlls/xaudio2_7/xaudio_dll.c
+37
-0
No files found.
dlls/xaudio2_7/xaudio_dll.c
View file @
66a58ad5
...
...
@@ -639,8 +639,45 @@ static HRESULT WINAPI XA2SRC_SubmitSourceBuffer(IXAudio2SourceVoice *iface,
static
HRESULT
WINAPI
XA2SRC_FlushSourceBuffers
(
IXAudio2SourceVoice
*
iface
)
{
UINT
i
,
first
,
last
,
to_flush
;
XA2SourceImpl
*
This
=
impl_from_IXAudio2SourceVoice
(
iface
);
TRACE
(
"%p
\n
"
,
This
);
EnterCriticalSection
(
&
This
->
lock
);
if
(
This
->
running
&&
This
->
nbufs
>
0
){
/* when running, flush only completely unused buffers; the rest remain
* in queue */
last
=
(
This
->
first_buf
+
This
->
nbufs
)
%
XAUDIO2_MAX_QUEUED_BUFFERS
;
first
=
(
This
->
cur_buf
+
1
)
%
XAUDIO2_MAX_QUEUED_BUFFERS
;
if
(
This
->
cur_buf
==
last
)
/* nothing to do */
to_flush
=
0
;
else
if
(
last
>=
first
)
to_flush
=
last
-
first
;
else
to_flush
=
last
+
XAUDIO2_MAX_QUEUED_BUFFERS
-
first
;
}
else
{
/* when stopped, flush all buffers */
first
=
This
->
first_buf
;
last
=
(
This
->
first_buf
+
This
->
nbufs
)
%
XAUDIO2_MAX_QUEUED_BUFFERS
;
to_flush
=
This
->
nbufs
;
}
for
(
i
=
first
;
i
<
(
first
+
to_flush
)
%
XAUDIO2_MAX_QUEUED_BUFFERS
;
i
=
(
i
+
1
)
%
XAUDIO2_MAX_QUEUED_BUFFERS
){
if
(
This
->
cb
)
IXAudio2VoiceCallback_OnBufferEnd
(
This
->
cb
,
This
->
buffers
[
i
].
xa2buffer
.
pContext
);
}
This
->
nbufs
-=
to_flush
;
LeaveCriticalSection
(
&
This
->
lock
);
return
S_OK
;
}
...
...
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