Mercurial > hg > sonic-visualiser
comparison audioio/AudioJACKTarget.cpp @ 106:f8e362511b2f
* Probable fix to occasional channel misalignment during playback
author | Chris Cannam |
---|---|
date | Mon, 26 Feb 2007 16:32:37 +0000 |
parents | 0581d552481d |
children | 75b0087233d8 |
comparison
equal
deleted
inserted
replaced
105:0581d552481d | 106:f8e362511b2f |
---|---|
350 | 350 |
351 for (size_t ch = 0; ch < m_outputs.size(); ++ch) { | 351 for (size_t ch = 0; ch < m_outputs.size(); ++ch) { |
352 buffers[ch] = (float *)jack_port_get_buffer(m_outputs[ch], nframes); | 352 buffers[ch] = (float *)jack_port_get_buffer(m_outputs[ch], nframes); |
353 } | 353 } |
354 | 354 |
355 size_t received = 0; | |
356 | |
355 if (m_source) { | 357 if (m_source) { |
356 m_source->getSourceSamples(nframes, buffers); | 358 received = m_source->getSourceSamples(nframes, buffers); |
357 } else { | 359 } |
358 for (size_t ch = 0; ch < m_outputs.size(); ++ch) { | 360 |
359 for (size_t i = 0; i < nframes; ++i) { | 361 for (size_t ch = 0; ch < m_outputs.size(); ++ch) { |
360 buffers[ch][i] = 0.0; | 362 for (size_t i = received; i < nframes; ++i) { |
361 } | 363 buffers[ch][i] = 0.0; |
362 } | 364 } |
363 } | 365 } |
364 | 366 |
365 float peakLeft = 0.0, peakRight = 0.0; | 367 float peakLeft = 0.0, peakRight = 0.0; |
366 | 368 |
367 for (size_t ch = 0; ch < m_outputs.size(); ++ch) { | 369 for (size_t ch = 0; ch < m_outputs.size(); ++ch) { |