fixed two warnings

This commit is contained in:
Volker Fischer 2015-11-13 21:57:24 +00:00
parent 15e44213a7
commit 89f8578efb

View file

@ -282,7 +282,7 @@ void CSound::GetAudioDeviceInfos ( const AudioDeviceID DeviceID,
stPropertyAddress.mScope = kAudioDevicePropertyScopeOutput; stPropertyAddress.mScope = kAudioDevicePropertyScopeOutput;
} }
stPropertyAddress.mElement = 0; // channel stPropertyAddress.mElement = 0;
AudioObjectGetPropertyData ( DeviceID, AudioObjectGetPropertyData ( DeviceID,
&stPropertyAddress, &stPropertyAddress,
@ -502,24 +502,37 @@ UInt32 CSound::SetBufferSize ( AudioDeviceID& audioDeviceID,
const bool bIsInput, const bool bIsInput,
UInt32 iPrefBufferSize ) UInt32 iPrefBufferSize )
{ {
AudioObjectPropertyAddress stPropertyAddress;
stPropertyAddress.mSelector = kAudioDevicePropertyBufferFrameSize;
if ( bIsInput )
{
stPropertyAddress.mScope = kAudioDevicePropertyScopeInput;
}
else
{
stPropertyAddress.mScope = kAudioDevicePropertyScopeOutput;
}
stPropertyAddress.mElement = 0;
// first set the value // first set the value
UInt32 iSizeBufValue = sizeof ( UInt32 ); UInt32 iSizeBufValue = sizeof ( UInt32 );
AudioDeviceSetProperty ( audioDeviceID, AudioObjectSetPropertyData ( audioDeviceID,
NULL, &stPropertyAddress,
0, 0,
bIsInput, NULL,
kAudioDevicePropertyBufferFrameSize, iSizeBufValue,
iSizeBufValue, &iPrefBufferSize );
&iPrefBufferSize );
// read back which value is actually used // read back which value is actually used
UInt32 iActualMonoBufferSize; UInt32 iActualMonoBufferSize;
AudioDeviceGetProperty ( audioDeviceID, AudioObjectGetPropertyData ( audioDeviceID,
0, &stPropertyAddress,
bIsInput, 0,
kAudioDevicePropertyBufferFrameSize, NULL,
&iSizeBufValue, &iSizeBufValue,
&iActualMonoBufferSize ); &iActualMonoBufferSize );
return iActualMonoBufferSize; return iActualMonoBufferSize;
} }