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
2fc548ae
Commit
2fc548ae
authored
Jul 13, 2007
by
Ken Thomases
Committed by
Alexandre Julliard
Jul 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecoreaudio: Correct the AudioBufferList allocated for input.
parent
6805bf8a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
11 deletions
+28
-11
audio.c
dlls/winecoreaudio.drv/audio.c
+28
-11
No files found.
dlls/winecoreaudio.drv/audio.c
View file @
2fc548ae
...
...
@@ -1732,21 +1732,40 @@ static void widHelper_DestroyAudioBufferList(AudioBufferList* list)
* widHelper_AllocateAudioBufferList [internal]
* Convenience function to allocate our audio buffers
*/
static
AudioBufferList
*
widHelper_AllocateAudioBufferList
(
UInt32
numChannels
,
UInt32
size
)
static
AudioBufferList
*
widHelper_AllocateAudioBufferList
(
UInt32
numChannels
,
UInt32
bitsPerChannel
,
UInt32
bufferFrames
,
BOOL
interleaved
)
{
UInt32
numBuffers
;
UInt32
channelsPerFrame
;
UInt32
bytesPerFrame
;
UInt32
bytesPerBuffer
;
AudioBufferList
*
list
;
UInt32
i
;
list
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
AudioBufferList
)
+
numChannels
*
sizeof
(
AudioBuffer
));
if
(
interleaved
)
{
/* For interleaved audio, we allocate one buffer for all channels. */
numBuffers
=
1
;
channelsPerFrame
=
numChannels
;
}
else
{
numBuffers
=
numChannels
;
channelsPerFrame
=
1
;
}
bytesPerFrame
=
bitsPerChannel
*
channelsPerFrame
/
8
;
bytesPerBuffer
=
bytesPerFrame
*
bufferFrames
;
list
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
offsetof
(
AudioBufferList
,
mBuffers
)
+
numBuffers
*
sizeof
(
AudioBuffer
));
if
(
list
==
NULL
)
return
NULL
;
list
->
mNumberBuffers
=
num
Channel
s
;
for
(
i
=
0
;
i
<
num
Channel
s
;
++
i
)
list
->
mNumberBuffers
=
num
Buffer
s
;
for
(
i
=
0
;
i
<
num
Buffer
s
;
++
i
)
{
list
->
mBuffers
[
i
].
mNumberChannels
=
1
;
list
->
mBuffers
[
i
].
mDataByteSize
=
size
;
list
->
mBuffers
[
i
].
mData
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
list
->
mBuffers
[
i
].
mNumberChannels
=
channelsPerFrame
;
list
->
mBuffers
[
i
].
mDataByteSize
=
bytesPerBuffer
;
list
->
mBuffers
[
i
].
mData
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bytesPerBuffer
);
if
(
list
->
mBuffers
[
i
].
mData
==
NULL
)
{
widHelper_DestroyAudioBufferList
(
list
);
...
...
@@ -1764,7 +1783,6 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
{
WINE_WAVEIN
*
wwi
;
UInt32
frameCount
;
UInt32
bytesPerFrame
;
TRACE
(
"(%u, %p, %08X);
\n
"
,
wDevID
,
lpDesc
,
dwFlags
);
if
(
lpDesc
==
NULL
)
...
...
@@ -1842,9 +1860,8 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
}
/* Allocate our audio buffers */
/* For interleaved audio, we allocate one buffer for all channels. */
bytesPerFrame
=
wwi
->
format
.
wBitsPerSample
*
wwi
->
format
.
wf
.
nChannels
/
8
;
wwi
->
bufferList
=
widHelper_AllocateAudioBufferList
(
1
,
wwi
->
format
.
wf
.
nChannels
*
frameCount
*
bytesPerFrame
);
wwi
->
bufferList
=
widHelper_AllocateAudioBufferList
(
wwi
->
format
.
wf
.
nChannels
,
wwi
->
format
.
wBitsPerSample
,
frameCount
,
TRUE
);
if
(
wwi
->
bufferList
==
NULL
)
{
ERR
(
"Failed to allocate buffer list
\n
"
);
...
...
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