Fixed more coding style errors.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38441 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2010-08-30 10:20:05 +00:00
parent 7e3a856975
commit 0960b6d0f1

View File

@ -120,32 +120,44 @@ MixerInput::GetMixerChannelCount()
inline bool
MixerInput::GetMixerChannelInfo(int mixer_channel, int64 framepos,
bigtime_t time, const float **buffer, uint32 *sample_offset, int *type,
float *gain)
MixerInput::GetMixerChannelInfo(int mixerChannel, int64 framepos,
bigtime_t time, const float** buffer, uint32* sampleOffset, int* type,
float* gain)
{
// this function should not be called if we don't have a mix buffer!
ASSERT(fMixBuffer);
ASSERT(mixer_channel >= 0 && mixer_channel < fMixerChannelCount);
ASSERT(fMixBuffer != NULL);
ASSERT(mixerChannel >= 0 && mixerChannel < fMixerChannelCount);
if (!fEnabled)
return false;
#if 1
if (time < (fLastDataAvailableTime - duration_for_frames(fMixBufferFrameRate, fMixBufferFrameCount))
|| (time + duration_for_frames(fMixBufferFrameRate, fDebugMixBufferFrames)) >= fLastDataAvailableTime)
ERROR("MixerInput::GetMixerChannelInfo: reading wrong data, have %Ld to %Ld, reading from %Ld to %Ld\n",
fLastDataAvailableTime - duration_for_frames(fMixBufferFrameRate, fMixBufferFrameCount), fLastDataAvailableTime, time, time + duration_for_frames(fMixBufferFrameRate, fDebugMixBufferFrames));
if (time < (fLastDataAvailableTime - duration_for_frames(
fMixBufferFrameRate, fMixBufferFrameCount))
|| (time + duration_for_frames(fMixBufferFrameRate,
fDebugMixBufferFrames)) >= fLastDataAvailableTime) {
ERROR("MixerInput::GetMixerChannelInfo: reading wrong data, have %Ld "
"to %Ld, reading from %Ld to %Ld\n",
fLastDataAvailableTime - duration_for_frames(fMixBufferFrameRate,
fMixBufferFrameCount), fLastDataAvailableTime, time,
time + duration_for_frames(fMixBufferFrameRate,
fDebugMixBufferFrames));
}
#endif
if (time > fLastDataAvailableTime)
return false;
int32 offset = framepos % fMixBufferFrameCount;
if (mixer_channel == 0) PRINT(3, "GetMixerChannelInfo: frames %ld to %ld\n", offset, offset + fDebugMixBufferFrames - 1);
*buffer = reinterpret_cast<float *>(reinterpret_cast<char *>(fMixerChannelInfo[mixer_channel].buffer_base) + (offset * sizeof(float) * fInputChannelCount));
*sample_offset = sizeof(float) * fInputChannelCount;
*type = fMixerChannelInfo[mixer_channel].destination_type;
*gain = fMixerChannelInfo[mixer_channel].destination_gain;
if (mixerChannel == 0) {
PRINT(3, "GetMixerChannelInfo: frames %ld to %ld\n", offset,
offset + fDebugMixBufferFrames - 1);
}
*buffer = reinterpret_cast<float*>(reinterpret_cast<char*>(
fMixerChannelInfo[mixerChannel].buffer_base)
+ (offset * sizeof(float) * fInputChannelCount));
*sampleOffset = sizeof(float) * fInputChannelCount;
*type = fMixerChannelInfo[mixerChannel].destination_type;
*gain = fMixerChannelInfo[mixerChannel].destination_gain;
return true;
}