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