fixed two warnings
This commit is contained in:
parent
15e44213a7
commit
89f8578efb
1 changed files with 27 additions and 14 deletions
|
@ -282,7 +282,7 @@ void CSound::GetAudioDeviceInfos ( const AudioDeviceID DeviceID,
|
|||
stPropertyAddress.mScope = kAudioDevicePropertyScopeOutput;
|
||||
}
|
||||
|
||||
stPropertyAddress.mElement = 0; // channel
|
||||
stPropertyAddress.mElement = 0;
|
||||
|
||||
AudioObjectGetPropertyData ( DeviceID,
|
||||
&stPropertyAddress,
|
||||
|
@ -502,22 +502,35 @@ UInt32 CSound::SetBufferSize ( AudioDeviceID& audioDeviceID,
|
|||
const bool bIsInput,
|
||||
UInt32 iPrefBufferSize )
|
||||
{
|
||||
AudioObjectPropertyAddress stPropertyAddress;
|
||||
stPropertyAddress.mSelector = kAudioDevicePropertyBufferFrameSize;
|
||||
|
||||
if ( bIsInput )
|
||||
{
|
||||
stPropertyAddress.mScope = kAudioDevicePropertyScopeInput;
|
||||
}
|
||||
else
|
||||
{
|
||||
stPropertyAddress.mScope = kAudioDevicePropertyScopeOutput;
|
||||
}
|
||||
|
||||
stPropertyAddress.mElement = 0;
|
||||
|
||||
// first set the value
|
||||
UInt32 iSizeBufValue = sizeof ( UInt32 );
|
||||
AudioDeviceSetProperty ( audioDeviceID,
|
||||
NULL,
|
||||
AudioObjectSetPropertyData ( audioDeviceID,
|
||||
&stPropertyAddress,
|
||||
0,
|
||||
bIsInput,
|
||||
kAudioDevicePropertyBufferFrameSize,
|
||||
NULL,
|
||||
iSizeBufValue,
|
||||
&iPrefBufferSize );
|
||||
|
||||
// read back which value is actually used
|
||||
UInt32 iActualMonoBufferSize;
|
||||
AudioDeviceGetProperty ( audioDeviceID,
|
||||
AudioObjectGetPropertyData ( audioDeviceID,
|
||||
&stPropertyAddress,
|
||||
0,
|
||||
bIsInput,
|
||||
kAudioDevicePropertyBufferFrameSize,
|
||||
NULL,
|
||||
&iSizeBufValue,
|
||||
&iActualMonoBufferSize );
|
||||
|
||||
|
|
Loading…
Reference in a new issue