One should be suspicious when subtracting "samples"

from "frames". LateNoticeReceived() would have skipped
two many buffers depending on the channel count.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38542 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2010-09-06 10:41:05 +00:00
parent 9abb7d4713
commit dec32162b5

View File

@ -520,12 +520,15 @@ AudioProducer::LateNoticeReceived(const media_source& what, bigtime_t howMuch,
SetEventLatency(fLatency + fInternalLatency);
} else {
// Skip one buffer ahead in the audio data.
size_t sampleSize
= fOutput.format.u.raw_audio.format
& media_raw_audio_format::B_AUDIO_SIZE_MASK;
size_t nSamples
size_t samplesPerBuffer
= fOutput.format.u.raw_audio.buffer_size / sampleSize;
fFramesSent += nSamples;
size_t framesPerBuffer
= samplesPerBuffer / fOutput.format.u.raw_audio.channel_count;
fFramesSent += framesPerBuffer;
}
}
}