fixed some casting bugs
fixed newline at end of file git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1241 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1246,7 +1246,7 @@ AudioMixer::HandleEvent( const media_timed_event *event, bigtime_t lateness,
|
|||||||
|
|
||||||
// calculate the start time for the next event
|
// calculate the start time for the next event
|
||||||
|
|
||||||
fNextEventTime = fStartTime + (double(fFramesSent / fOutput.format.u.raw_audio.frame_rate) * 1000000.0);
|
fNextEventTime = bigtime_t(fStartTime + double(fFramesSent / fOutput.format.u.raw_audio.frame_rate) * 1000000.0);
|
||||||
|
|
||||||
media_timed_event nextBufferEvent(fNextEventTime, BTimedEventQueue::B_HANDLE_BUFFER);
|
media_timed_event nextBufferEvent(fNextEventTime, BTimedEventQueue::B_HANDLE_BUFFER);
|
||||||
EventQueue()->AddEvent(nextBufferEvent);
|
EventQueue()->AddEvent(nextBufferEvent);
|
||||||
|
|||||||
@@ -214,4 +214,4 @@ class AudioMixer :
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ AudioMixer::FillMixBuffer(void *outbuffer, size_t ioSize)
|
|||||||
{
|
{
|
||||||
int sample = frameStart + chan;
|
int sample = frameStart + chan;
|
||||||
|
|
||||||
int inputValue = (32767 * indata[inputSample] * channel->fGainScale[chan]) + outdata[sample];
|
int inputValue = int((32767 * indata[inputSample] * channel->fGainScale[chan]) + outdata[sample]);
|
||||||
|
|
||||||
if (inputValue > 32767)
|
if (inputValue > 32767)
|
||||||
clipoffset[sample] = clipoffset[sample] + 1;
|
clipoffset[sample] = clipoffset[sample] + 1;
|
||||||
@@ -311,7 +311,7 @@ AudioMixer::FillMixBuffer(void *outbuffer, size_t ioSize)
|
|||||||
{
|
{
|
||||||
int sample = frameStart + chan;
|
int sample = frameStart + chan;
|
||||||
|
|
||||||
int clipTest = (outdata[sample] + (indata[inputSample] * channel->fGainScale[chan]));
|
int clipTest = int(outdata[sample] + (indata[inputSample] * channel->fGainScale[chan]));
|
||||||
|
|
||||||
if (clipTest > 32767)
|
if (clipTest > 32767)
|
||||||
clipoffset[sample] = clipoffset[sample] + 1;
|
clipoffset[sample] = clipoffset[sample] + 1;
|
||||||
@@ -430,7 +430,7 @@ AudioMixer::FillMixBuffer(void *outbuffer, size_t ioSize)
|
|||||||
{
|
{
|
||||||
int sample = frameStart + channel;
|
int sample = frameStart + channel;
|
||||||
|
|
||||||
int scaledSample = (outdata[sample] + (65536 * clipoffset[sample])) * fMasterGainScale[channel];
|
int scaledSample = int((outdata[sample] + (65536 * clipoffset[sample])) * fMasterGainScale[channel]);
|
||||||
|
|
||||||
if (scaledSample < -32768)
|
if (scaledSample < -32768)
|
||||||
outdata[sample] = -32768;
|
outdata[sample] = -32768;
|
||||||
@@ -449,4 +449,4 @@ AudioMixer::FillMixBuffer(void *outbuffer, size_t ioSize)
|
|||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,4 +40,4 @@ class mixer_input
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif;
|
#endif
|
||||||
|
|||||||
@@ -81,4 +81,4 @@ status_t AudioMixerAddon::GetConfigurationFor(
|
|||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// end
|
// end
|
||||||
|
|||||||
Reference in New Issue
Block a user