New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix waveform concurrency issues. Possible fix for Bug #1383404 #420
Conversation
24707ae
to
394f715
Compare
* Use const shared pointers for waveforms. * Move all std::vector sizing operations to the Waveform constructor. No vector state is allowed to change after the constructor finishes. * Clarify comments. * Remove waveform mutex usage in WOverview variants. * Use the track's waveform pointer to atomically swap the waveform rather than mutating the waveform in place. * Remove unused code.
@@ -252,13 +258,13 @@ void AnalyserWaveform::process(const CSAMPLE* buffer, const int bufferLength) { | |||
m_waveformSummary->setCompletion(m_currentSummaryStride); | |||
|
|||
#ifdef TEST_HEAT_MAP | |||
QPointF point(float(m_strideSummary.m_filteredData[Right][High]), | |||
float(m_strideSummary.m_filteredData[Right][ Mid])); | |||
QPointF point(float(m_stride.m_filteredData[Right][High]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might as well convert to c++ cast
pardon my usual ignorant questions |
:) notes addressed. |
|
||
// If stored in the database, the ID of the waveform. | ||
int m_id; | ||
bool m_bDirty; | ||
mutable bool m_bDirty; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might as well put a comment about why this is mutable
one last note, LGTM |
m_waveformData = &m_waveform->at(0); | ||
m_waveformSummaryData = &m_waveformSummary->at(0); | ||
m_waveformData = m_waveform->data(); | ||
m_waveformSummaryData = m_waveformSummary->data(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should get rid of this by moving the m_waveformSummary->data() Into WaveformStride::store()
Thank you for picking this up. Since this this solves an annoying bug it LGTM |
Fix waveform concurrency issues. Possible fix for Bug #1383404
🚬 |
vector state is allowed to change after the constructor finishes.
rather than mutating the waveform in place.