correctly affect speed/reversing when shuttling audio
This commit is contained in:
@@ -73,21 +73,8 @@ NodeValueTable AudioRenderWorker::RenderBlock(const TrackOutput *track, const Ti
|
||||
}
|
||||
|
||||
if (b->is_reversed()) {
|
||||
int sample_size = audio_params_.samples_to_bytes(1);
|
||||
int half_buffer_sz = samples_from_this_block.size() / 2;
|
||||
char* temp_buffer = new char[sample_size];
|
||||
|
||||
for (int src_index=0;src_index<half_buffer_sz;src_index+=sample_size) {
|
||||
char* src_ptr = samples_from_this_block.data() + src_index;
|
||||
char* dst_ptr = samples_from_this_block.data() + samples_from_this_block.size() - sample_size - src_index;
|
||||
|
||||
// Simple swap
|
||||
memcpy(temp_buffer, src_ptr, static_cast<size_t>(sample_size));
|
||||
memcpy(src_ptr, dst_ptr, static_cast<size_t>(sample_size));
|
||||
memcpy(dst_ptr, temp_buffer, static_cast<size_t>(sample_size));
|
||||
}
|
||||
|
||||
delete [] temp_buffer;
|
||||
// Reverse the audio buffer
|
||||
AudioManager::ReverseBuffer(samples_from_this_block.data(), samples_from_this_block.size(), audio_params_.samples_to_bytes(1));
|
||||
}
|
||||
|
||||
copied_size = samples_from_this_block.size();
|
||||
|
||||
Reference in New Issue
Block a user