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
2e7ee8d9
Commit
2e7ee8d9
authored
Jan 04, 2011
by
Andrew Eikum
Committed by
Alexandre Julliard
Jan 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi: Be explicit about units in IAudioRenderClient::ReleaseBuffer.
parent
0b608d0f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
17 deletions
+13
-17
audio.c
dlls/mmdevapi/audio.c
+13
-17
No files found.
dlls/mmdevapi/audio.c
View file @
2e7ee8d9
...
...
@@ -1196,26 +1196,26 @@ static HRESULT WINAPI ACR_GetBuffer(IAudioRenderClient *iface, UINT32 frames, BY
return
S_OK
;
}
static
HRESULT
WINAPI
ACR_ReleaseBuffer
(
IAudioRenderClient
*
iface
,
UINT32
written
,
DWORD
flags
)
static
HRESULT
WINAPI
ACR_ReleaseBuffer
(
IAudioRenderClient
*
iface
,
UINT32
written
_frames
,
DWORD
flags
)
{
ACRender
*
This
=
(
ACRender
*
)
iface
;
BYTE
*
buf
=
This
->
parent
->
buffer
;
DWORD
framesize
=
This
->
parent
->
pwfx
->
nBlockAlign
;
DWORD
ofs
=
This
->
parent
->
ofs_frames
;
DWORD
bufsize
=
This
->
parent
->
bufsize_frames
;
DWORD
ofs
_bytes
=
This
->
parent
->
ofs_frames
*
framesize
;
DWORD
written_bytes
=
written_frames
*
framesize
;
DWORD
freq
=
This
->
parent
->
pwfx
->
nSamplesPerSec
;
DWORD
bpp
=
This
->
parent
->
pwfx
->
wBitsPerSample
;
ALuint
albuf
;
TRACE
(
"(%p)->(%u,%x)
\n
"
,
This
,
written
,
flags
);
TRACE
(
"(%p)->(%u,%x)
\n
"
,
This
,
written
_frames
,
flags
);
if
(
This
->
parent
->
locked
<
written
)
if
(
This
->
parent
->
locked
<
written
_frames
)
return
AUDCLNT_E_INVALID_SIZE
;
if
(
flags
&
~
AUDCLNT_BUFFERFLAGS_SILENT
)
return
E_INVALIDARG
;
if
(
!
written
)
{
if
(
!
written
_frames
)
{
if
(
This
->
parent
->
locked
)
FIXME
(
"Handled right?
\n
"
);
This
->
parent
->
locked
=
0
;
...
...
@@ -1227,25 +1227,21 @@ static HRESULT WINAPI ACR_ReleaseBuffer(IAudioRenderClient *iface, UINT32 writte
EnterCriticalSection
(
This
->
parent
->
crst
);
This
->
parent
->
ofs_frames
+=
written
;
This
->
parent
->
ofs_frames
%=
bufsize
;
This
->
parent
->
pad
+=
written
;
This
->
parent
->
frameswritten
+=
written
;
This
->
parent
->
ofs_frames
+=
written
_frames
;
This
->
parent
->
ofs_frames
%=
This
->
parent
->
bufsize_frames
;
This
->
parent
->
pad
+=
written
_frames
;
This
->
parent
->
frameswritten
+=
written
_frames
;
This
->
parent
->
locked
=
0
;
ofs
*=
framesize
;
written
*=
framesize
;
bufsize
*=
framesize
;
if
(
flags
&
AUDCLNT_BUFFERFLAGS_SILENT
)
memset
(
buf
+
ofs
,
bpp
!=
8
?
0
:
128
,
written
);
TRACE
(
"buf: %p, ofs: %x, written %u, freq %u
\n
"
,
buf
,
ofs
,
written
,
freq
);
memset
(
buf
+
ofs_bytes
,
bpp
!=
8
?
0
:
128
,
written_bytes
);
TRACE
(
"buf: %p, ofs: %x, written %u, freq %u
\n
"
,
buf
,
ofs
_bytes
,
written_bytes
,
freq
);
if
(
!
valid_dev
(
This
->
parent
))
goto
out
;
setALContext
(
This
->
parent
->
parent
->
ctx
);
palGenBuffers
(
1
,
&
albuf
);
palBufferData
(
albuf
,
This
->
parent
->
format
,
buf
+
ofs
,
written
,
freq
);
palBufferData
(
albuf
,
This
->
parent
->
format
,
buf
+
ofs_bytes
,
written_bytes
,
freq
);
palSourceQueueBuffers
(
This
->
parent
->
source
,
1
,
&
albuf
);
TRACE
(
"Queued %u
\n
"
,
albuf
);
...
...
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