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
abf5b64f
Commit
abf5b64f
authored
Aug 09, 2011
by
Jörg Höhle
Committed by
Alexandre Julliard
Aug 30, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi: Do not mix frames and bytes.
parent
74566422
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
mmdevdrv.c
dlls/winealsa.drv/mmdevdrv.c
+4
-4
mmdevdrv.c
dlls/wineoss.drv/mmdevdrv.c
+4
-4
No files found.
dlls/winealsa.drv/mmdevdrv.c
View file @
abf5b64f
...
@@ -1994,15 +1994,16 @@ static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface,
...
@@ -1994,15 +1994,16 @@ static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface,
return
S_OK
;
return
S_OK
;
}
}
static
void
alsa_wrap_buffer
(
ACImpl
*
This
,
BYTE
*
buffer
,
UINT32
written_
byt
es
)
static
void
alsa_wrap_buffer
(
ACImpl
*
This
,
BYTE
*
buffer
,
UINT32
written_
fram
es
)
{
{
snd_pcm_uframes_t
write_offs_frames
=
snd_pcm_uframes_t
write_offs_frames
=
(
This
->
lcl_offs_frames
+
This
->
held_frames
)
%
This
->
bufsize_frames
;
(
This
->
lcl_offs_frames
+
This
->
held_frames
)
%
This
->
bufsize_frames
;
UINT32
write_offs_bytes
=
write_offs_frames
*
This
->
fmt
->
nBlockAlign
;
UINT32
write_offs_bytes
=
write_offs_frames
*
This
->
fmt
->
nBlockAlign
;
snd_pcm_uframes_t
chunk_frames
=
This
->
bufsize_frames
-
write_offs_frames
;
snd_pcm_uframes_t
chunk_frames
=
This
->
bufsize_frames
-
write_offs_frames
;
UINT32
chunk_bytes
=
chunk_frames
*
This
->
fmt
->
nBlockAlign
;
UINT32
chunk_bytes
=
chunk_frames
*
This
->
fmt
->
nBlockAlign
;
UINT32
written_bytes
=
written_frames
*
This
->
fmt
->
nBlockAlign
;
if
(
written_bytes
<
chunk_bytes
){
if
(
written_bytes
<
=
chunk_bytes
){
memcpy
(
This
->
local_buffer
+
write_offs_bytes
,
buffer
,
written_bytes
);
memcpy
(
This
->
local_buffer
+
write_offs_bytes
,
buffer
,
written_bytes
);
}
else
{
}
else
{
memcpy
(
This
->
local_buffer
+
write_offs_bytes
,
buffer
,
chunk_bytes
);
memcpy
(
This
->
local_buffer
+
write_offs_bytes
,
buffer
,
chunk_bytes
);
...
@@ -2015,7 +2016,6 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer(
...
@@ -2015,7 +2016,6 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer(
IAudioRenderClient
*
iface
,
UINT32
written_frames
,
DWORD
flags
)
IAudioRenderClient
*
iface
,
UINT32
written_frames
,
DWORD
flags
)
{
{
ACImpl
*
This
=
impl_from_IAudioRenderClient
(
iface
);
ACImpl
*
This
=
impl_from_IAudioRenderClient
(
iface
);
UINT32
written_bytes
=
written_frames
*
This
->
fmt
->
nBlockAlign
;
BYTE
*
buffer
;
BYTE
*
buffer
;
HRESULT
hr
;
HRESULT
hr
;
...
@@ -2048,7 +2048,7 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer(
...
@@ -2048,7 +2048,7 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer(
if
(
This
->
held_frames
){
if
(
This
->
held_frames
){
if
(
This
->
buf_state
==
LOCKED_WRAPPED
)
if
(
This
->
buf_state
==
LOCKED_WRAPPED
)
alsa_wrap_buffer
(
This
,
buffer
,
written_
byt
es
);
alsa_wrap_buffer
(
This
,
buffer
,
written_
fram
es
);
This
->
held_frames
+=
written_frames
;
This
->
held_frames
+=
written_frames
;
}
else
{
}
else
{
...
...
dlls/wineoss.drv/mmdevdrv.c
View file @
abf5b64f
...
@@ -1625,15 +1625,16 @@ static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface,
...
@@ -1625,15 +1625,16 @@ static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface,
return
S_OK
;
return
S_OK
;
}
}
static
void
oss_wrap_buffer
(
ACImpl
*
This
,
BYTE
*
buffer
,
UINT32
written_
byt
es
)
static
void
oss_wrap_buffer
(
ACImpl
*
This
,
BYTE
*
buffer
,
UINT32
written_
fram
es
)
{
{
UINT32
write_offs_frames
=
UINT32
write_offs_frames
=
(
This
->
lcl_offs_frames
+
This
->
held_frames
)
%
This
->
bufsize_frames
;
(
This
->
lcl_offs_frames
+
This
->
held_frames
)
%
This
->
bufsize_frames
;
UINT32
write_offs_bytes
=
write_offs_frames
*
This
->
fmt
->
nBlockAlign
;
UINT32
write_offs_bytes
=
write_offs_frames
*
This
->
fmt
->
nBlockAlign
;
UINT32
chunk_frames
=
This
->
bufsize_frames
-
write_offs_frames
;
UINT32
chunk_frames
=
This
->
bufsize_frames
-
write_offs_frames
;
UINT32
chunk_bytes
=
chunk_frames
*
This
->
fmt
->
nBlockAlign
;
UINT32
chunk_bytes
=
chunk_frames
*
This
->
fmt
->
nBlockAlign
;
UINT32
written_bytes
=
written_frames
*
This
->
fmt
->
nBlockAlign
;
if
(
written_bytes
<
chunk_bytes
){
if
(
written_bytes
<
=
chunk_bytes
){
memcpy
(
This
->
local_buffer
+
write_offs_bytes
,
buffer
,
written_bytes
);
memcpy
(
This
->
local_buffer
+
write_offs_bytes
,
buffer
,
written_bytes
);
}
else
{
}
else
{
memcpy
(
This
->
local_buffer
+
write_offs_bytes
,
buffer
,
chunk_bytes
);
memcpy
(
This
->
local_buffer
+
write_offs_bytes
,
buffer
,
chunk_bytes
);
...
@@ -1647,7 +1648,6 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer(
...
@@ -1647,7 +1648,6 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer(
{
{
ACImpl
*
This
=
impl_from_IAudioRenderClient
(
iface
);
ACImpl
*
This
=
impl_from_IAudioRenderClient
(
iface
);
BYTE
*
buffer
;
BYTE
*
buffer
;
UINT32
written_bytes
=
written_frames
*
This
->
fmt
->
nBlockAlign
;
TRACE
(
"(%p)->(%u, %x)
\n
"
,
This
,
written_frames
,
flags
);
TRACE
(
"(%p)->(%u, %x)
\n
"
,
This
,
written_frames
,
flags
);
...
@@ -1670,7 +1670,7 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer(
...
@@ -1670,7 +1670,7 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer(
if
(
This
->
held_frames
){
if
(
This
->
held_frames
){
if
(
This
->
buf_state
==
LOCKED_WRAPPED
)
if
(
This
->
buf_state
==
LOCKED_WRAPPED
)
oss_wrap_buffer
(
This
,
buffer
,
written_
byt
es
);
oss_wrap_buffer
(
This
,
buffer
,
written_
fram
es
);
This
->
held_frames
+=
written_frames
;
This
->
held_frames
+=
written_frames
;
}
else
{
}
else
{
...
...
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