You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Fixed an issue with reversed resampled audio in FrameMapper, which caused lots of clicks / seams between frames... Also, added a new overload to GetInterleavedAudioSamples, to reverse the samples before returning the float* array. Essentially, the FrameMapper is now aware of it's parent clip, and especially the 'time' keyframe, if the audio is in the forward or reverse direction. Also fixed a memory leak in time remapping.
This commit is contained in:
@@ -372,13 +372,18 @@ float* Frame::GetPlanarAudioSamples(int new_sample_rate, AudioResampler* resampl
|
||||
|
||||
|
||||
// Get an array of sample data (all channels interleaved together), using any sample rate
|
||||
float* Frame::GetInterleavedAudioSamples(int new_sample_rate, AudioResampler* resampler, int* sample_count)
|
||||
float* Frame::GetInterleavedAudioSamples(int new_sample_rate, AudioResampler* resampler, int* sample_count, bool reverse)
|
||||
{
|
||||
float *output = NULL;
|
||||
juce::AudioBuffer<float> *buffer(audio.get());
|
||||
int num_of_channels = audio->getNumChannels();
|
||||
int num_of_samples = GetAudioSamplesCount();
|
||||
|
||||
if (reverse) {
|
||||
// Reverse audio samples (if needed)
|
||||
buffer->reverse(0, buffer->getNumSamples());
|
||||
}
|
||||
|
||||
// Resample to new sample rate (if needed)
|
||||
if (new_sample_rate != sample_rate && resampler)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user