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
4b904bbf
Commit
4b904bbf
authored
Dec 28, 2006
by
Ken Thomases
Committed by
Alexandre Julliard
Dec 29, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecoreaudio: Do additional setup in AudioUnit_CreateInputUnit.
It now returns in an output parameter the frame count that the AU will use. Also, initialize the Audio Unit.
parent
5c489283
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
4 deletions
+32
-4
audio.c
dlls/winmm/winecoreaudio/audio.c
+5
-3
audiounit.c
dlls/winmm/winecoreaudio/audiounit.c
+27
-1
No files found.
dlls/winmm/winecoreaudio/audio.c
View file @
4b904bbf
...
...
@@ -211,7 +211,8 @@ extern int AudioUnit_SetVolume(AudioUnit au, float left, float right);
extern
int
AudioUnit_GetVolume
(
AudioUnit
au
,
float
*
left
,
float
*
right
);
extern
int
AudioUnit_CreateInputUnit
(
void
*
wwi
,
AudioUnit
*
out_au
,
WORD
nChannels
,
DWORD
nSamplesPerSec
,
WORD
wBitsPerSample
);
WORD
nChannels
,
DWORD
nSamplesPerSec
,
WORD
wBitsPerSample
,
UInt32
*
outFrameCount
);
OSStatus
CoreAudio_woAudioUnitIOProc
(
void
*
inRefCon
,
AudioUnitRenderActionFlags
*
ioActionFlags
,
...
...
@@ -1522,7 +1523,8 @@ static DWORD widGetDevCaps(WORD wDevID, LPWAVEINCAPSW lpCaps, DWORD dwSize)
*/
static
DWORD
widOpen
(
WORD
wDevID
,
LPWAVEOPENDESC
lpDesc
,
DWORD
dwFlags
)
{
WINE_WAVEIN
*
wwi
;
WINE_WAVEIN
*
wwi
;
UInt32
frameCount
;
TRACE
(
"(%u, %p, %08X);
\n
"
,
wDevID
,
lpDesc
,
dwFlags
);
if
(
lpDesc
==
NULL
)
...
...
@@ -1592,7 +1594,7 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
if
(
!
AudioUnit_CreateInputUnit
(
wwi
,
&
wwi
->
audioUnit
,
wwi
->
format
.
wf
.
nChannels
,
wwi
->
format
.
wf
.
nSamplesPerSec
,
wwi
->
format
.
wBitsPerSample
))
wwi
->
format
.
wBitsPerSample
,
&
frameCount
))
{
ERR
(
"AudioUnit_CreateInputUnit failed
\n
"
);
OSSpinLockUnlock
(
&
wwi
->
lock
);
...
...
dlls/winmm/winecoreaudio/audiounit.c
View file @
4b904bbf
...
...
@@ -131,7 +131,8 @@ int AudioUnit_GetVolume(AudioUnit au, float *left, float *right)
int
AudioUnit_CreateInputUnit
(
void
*
wwi
,
AudioUnit
*
out_au
,
WORD
nChannels
,
DWORD
nSamplesPerSec
,
WORD
wBitsPerSample
)
WORD
nChannels
,
DWORD
nSamplesPerSec
,
WORD
wBitsPerSample
,
UInt32
*
outFrameCount
)
{
OSStatus
err
=
noErr
;
ComponentDescription
description
;
...
...
@@ -143,6 +144,12 @@ int AudioUnit_CreateInputUnit(void* wwi, AudioUnit* out_au,
AudioStreamBasicDescription
desiredFormat
;
if
(
!
outFrameCount
)
{
ERR
(
"Invalid parameter
\n
"
);
return
0
;
}
/* Open the AudioOutputUnit */
description
.
componentType
=
kAudioUnitType_Output
;
description
.
componentSubType
=
kAudioUnitSubType_HALOutput
;
...
...
@@ -244,6 +251,25 @@ int AudioUnit_CreateInputUnit(void* wwi, AudioUnit* out_au,
goto
error
;
}
/* Get the number of frames in the IO buffer(s) */
param
=
sizeof
(
*
outFrameCount
);
err
=
AudioUnitGetProperty
(
au
,
kAudioDevicePropertyBufferFrameSize
,
kAudioUnitScope_Global
,
0
,
outFrameCount
,
&
param
);
if
(
err
!=
noErr
)
{
ERR
(
"Failed to get audio sample size: %08lx
\n
"
,
err
);
goto
error
;
}
TRACE
(
"Frame count: %lu
\n
"
,
*
outFrameCount
);
/* Initialize the AU */
err
=
AudioUnitInitialize
(
au
);
if
(
err
!=
noErr
)
{
ERR
(
"Failed to initialize AU: %08lx
\n
"
,
err
);
goto
error
;
}
*
out_au
=
au
;
return
1
;
...
...
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