Fixed a big audio bug, where varying timestamp values on low precision audio timebases (i.e. 1/1000) would leave small gaps in the audio wave. Also, fixed a few issues related to sample_rate getting lost between the reader and clip and timeline objects.

This commit is contained in:
Jonathan Thomas
2012-11-20 16:22:50 -06:00
parent 7e51c204f9
commit 495ca9dc9e
9 changed files with 35 additions and 58 deletions

View File

@@ -526,9 +526,6 @@ void Frame::AddImage(tr1::shared_ptr<Magick::Image> new_image, float alpha)
// Add audio samples to a specific channel
void Frame::AddAudio(int destChannel, int destStartSample, const float* source, int numSamples, float gainToApplyToSource = 1.0f)
{
if (number >= 181 && number < 220)
cout << "AddAudio for frame: " << number << ", destChannel: " << destChannel << ", destStartSample: " << destStartSample << ", numSamples: " << numSamples << ", ending sample: " << (destStartSample + numSamples) << endl;
// Extend audio buffer (if needed)
if (destStartSample + numSamples > audio->getNumSamples())
audio->setSize(audio->getNumChannels(), destStartSample + numSamples, true, true, false);