Fixed some major issues with the frame mapper. openshot::FrameMapper is now fully multi-threaded. Fixed a bug in calculating the # of samples on a frame (to always be evenly divisible by the # of channels).

This commit is contained in:
Jonathan Thomas
2015-03-08 21:42:53 -05:00
parent db4a5a7948
commit 591cfbdb5a
8 changed files with 187 additions and 142 deletions

View File

@@ -214,7 +214,7 @@ void AudioReaderSource::getNextAudioBlock (const AudioSourceChannelInfo& info)
}
// Adjust estimate frame number (the estimated frame number that is being played)
estimated_samples_per_frame = Frame::GetSamplesPerFrame(estimated_frame, reader->info.fps, reader->info.sample_rate);
estimated_samples_per_frame = Frame::GetSamplesPerFrame(estimated_frame, reader->info.fps, reader->info.sample_rate, buffer_channels);
if (speed == 1)
estimated_frame += double(info.numSamples) / double(estimated_samples_per_frame);
}