"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/AV/Output/Synchronizer.cpp" between
ssr-0.4.1.tar.gz and ssr-0.4.2.tar.gz

About: SimpleScreenRecorder is a screen (video-audio) recorder for Linux.

Synchronizer.cpp  (ssr-0.4.1):Synchronizer.cpp  (ssr-0.4.2)
skipping to change at line 467 skipping to change at line 467
int n = (int) round(current_drift * (double) sample_rate); int n = (int) round(current_drift * (double) sample_rate);
if(n > 0) { if(n > 0) {
if(n >= (int) sample_count) { if(n >= (int) sample_count) {
audiolock->m_drop_samples = true; audiolock->m_drop_samples = true;
return; // drop all samples return; // drop all samples
} }
if(format == AV_SAMPLE_FMT_FLT) { if(format == AV_SAMPLE_FMT_FLT) {
data += n * channels * sizeof(float); data += n * channels * sizeof(float);
} else if(format == AV_SAMPLE_FMT_S16) { } else if(format == AV_SAMPLE_FMT_S16) {
data += n * channels * sizeof(int16_t); data += n * channels * sizeof(int16_t);
} else if(format == AV_SAMPLE_FMT_S32) {
data += n * channels * sizeof(int32_t);
} else { } else {
assert(false); assert(false);
} }
sample_count -= n; sample_count -= n;
} }
} }
// insert zeros // insert zeros
unsigned int sample_count_out = 0; unsigned int sample_count_out = 0;
skipping to change at line 534 skipping to change at line 536
data_float = (const float*) data; data_float = (const float*) data;
} else { } else {
audiolock->m_temp_input_buffer.Alloc(sample_count * m_out put_format->m_audio_channels); audiolock->m_temp_input_buffer.Alloc(sample_count * m_out put_format->m_audio_channels);
data_float = audiolock->m_temp_input_buffer.GetData(); data_float = audiolock->m_temp_input_buffer.GetData();
SampleChannelRemap(sample_count, (const float*) data, cha nnels, audiolock->m_temp_input_buffer.GetData(), m_output_format->m_audio_channe ls); SampleChannelRemap(sample_count, (const float*) data, cha nnels, audiolock->m_temp_input_buffer.GetData(), m_output_format->m_audio_channe ls);
} }
} else if(format == AV_SAMPLE_FMT_S16) { } else if(format == AV_SAMPLE_FMT_S16) {
audiolock->m_temp_input_buffer.Alloc(sample_count * m_output_form at->m_audio_channels); audiolock->m_temp_input_buffer.Alloc(sample_count * m_output_form at->m_audio_channels);
data_float = audiolock->m_temp_input_buffer.GetData(); data_float = audiolock->m_temp_input_buffer.GetData();
SampleChannelRemap(sample_count, (const int16_t*) data, channels, audiolock->m_temp_input_buffer.GetData(), m_output_format->m_audio_channels); SampleChannelRemap(sample_count, (const int16_t*) data, channels, audiolock->m_temp_input_buffer.GetData(), m_output_format->m_audio_channels);
} else if(format == AV_SAMPLE_FMT_S32) {
audiolock->m_temp_input_buffer.Alloc(sample_count * m_output_form
at->m_audio_channels);
data_float = audiolock->m_temp_input_buffer.GetData();
SampleChannelRemap(sample_count, (const int32_t*) data, channels,
audiolock->m_temp_input_buffer.GetData(), m_output_format->m_audio_channels);
} else { } else {
assert(false); assert(false);
} }
// resample // resample
sample_count_out = audiolock->m_fast_resampler->Resample((double) sample_ rate / (double) m_output_format->m_audio_sample_rate, 1.0 / (1.0 - drift_correct ion), sample_count_out = audiolock->m_fast_resampler->Resample((double) sample_ rate / (double) m_output_format->m_audio_sample_rate, 1.0 / (1.0 - drift_correct ion),
data_float, sample_count, &audiolock->m_ temp_output_buffer, sample_count_out); data_float, sample_count, &audiolock->m_ temp_output_buffer, sample_count_out);
audiolock->m_samples_written += sample_count_out; audiolock->m_samples_written += sample_count_out;
SharedLock lock(&m_shared_data); SharedLock lock(&m_shared_data);
 End of changes. 2 change blocks. 
0 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)