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
19e9de7d
Commit
19e9de7d
authored
Aug 21, 2012
by
Andrew Eikum
Committed by
Alexandre Julliard
Aug 22, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winealsa.drv: Special-case copying common sample sizes in a tight loop.
parent
e282d418
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
6 deletions
+51
-6
mmdevdrv.c
dlls/winealsa.drv/mmdevdrv.c
+51
-6
No files found.
dlls/winealsa.drv/mmdevdrv.c
View file @
19e9de7d
...
...
@@ -1828,22 +1828,67 @@ static BYTE *remap_channels(ACImpl *This, BYTE *buf, snd_pcm_uframes_t frames)
if
(
!
This
->
remapping_buf
){
This
->
remapping_buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
This
->
fmt
->
wBitsPerSample
/
8
)
*
This
->
alsa_channels
*
frames
);
bytes_per_sample
*
This
->
alsa_channels
*
frames
);
This
->
remapping_buf_frames
=
frames
;
}
else
if
(
This
->
remapping_buf_frames
<
frames
){
This
->
remapping_buf
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
This
->
remapping_buf
,
(
This
->
fmt
->
wBitsPerSample
/
8
)
*
This
->
alsa_channels
*
frames
);
bytes_per_sample
*
This
->
alsa_channels
*
frames
);
This
->
remapping_buf_frames
=
frames
;
}
snd_pcm_format_set_silence
(
This
->
alsa_format
,
This
->
remapping_buf
,
frames
*
This
->
alsa_channels
);
for
(
i
=
0
;
i
<
frames
;
++
i
){
for
(
c
=
0
;
c
<
This
->
fmt
->
nChannels
;
++
c
){
memcpy
(
&
This
->
remapping_buf
[(
i
*
This
->
alsa_channels
+
This
->
alsa_channel_map
[
c
])
*
bytes_per_sample
],
&
buf
[(
i
*
This
->
fmt
->
nChannels
+
c
)
*
bytes_per_sample
],
bytes_per_sample
);
switch
(
This
->
fmt
->
wBitsPerSample
){
case
8
:
{
UINT8
*
tgt_buf
,
*
src_buf
;
tgt_buf
=
This
->
remapping_buf
;
src_buf
=
buf
;
for
(
i
=
0
;
i
<
frames
;
++
i
){
for
(
c
=
0
;
c
<
This
->
fmt
->
nChannels
;
++
c
)
tgt_buf
[
This
->
alsa_channel_map
[
c
]]
=
src_buf
[
c
];
tgt_buf
+=
This
->
alsa_channels
;
src_buf
+=
This
->
fmt
->
nChannels
;
}
break
;
}
case
16
:
{
UINT16
*
tgt_buf
,
*
src_buf
;
tgt_buf
=
(
UINT16
*
)
This
->
remapping_buf
;
src_buf
=
(
UINT16
*
)
buf
;
for
(
i
=
0
;
i
<
frames
;
++
i
){
for
(
c
=
0
;
c
<
This
->
fmt
->
nChannels
;
++
c
)
tgt_buf
[
This
->
alsa_channel_map
[
c
]]
=
src_buf
[
c
];
tgt_buf
+=
This
->
alsa_channels
;
src_buf
+=
This
->
fmt
->
nChannels
;
}
}
break
;
case
32
:
{
UINT32
*
tgt_buf
,
*
src_buf
;
tgt_buf
=
(
UINT32
*
)
This
->
remapping_buf
;
src_buf
=
(
UINT32
*
)
buf
;
for
(
i
=
0
;
i
<
frames
;
++
i
){
for
(
c
=
0
;
c
<
This
->
fmt
->
nChannels
;
++
c
)
tgt_buf
[
This
->
alsa_channel_map
[
c
]]
=
src_buf
[
c
];
tgt_buf
+=
This
->
alsa_channels
;
src_buf
+=
This
->
fmt
->
nChannels
;
}
}
break
;
default:
{
BYTE
*
tgt_buf
,
*
src_buf
;
tgt_buf
=
This
->
remapping_buf
;
src_buf
=
buf
;
for
(
i
=
0
;
i
<
frames
;
++
i
){
for
(
c
=
0
;
c
<
This
->
fmt
->
nChannels
;
++
c
)
memcpy
(
&
tgt_buf
[
This
->
alsa_channel_map
[
c
]
*
bytes_per_sample
],
&
src_buf
[
c
*
bytes_per_sample
],
bytes_per_sample
);
tgt_buf
+=
This
->
alsa_channels
*
bytes_per_sample
;
src_buf
+=
This
->
fmt
->
nChannels
*
bytes_per_sample
;
}
}
break
;
}
return
This
->
remapping_buf
;
...
...
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