Skip to content
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

Merged
merged 3 commits into from Dec 4, 2014

Conversation

rryan
Copy link
Member

@rryan rryan commented Dec 3, 2014

  • 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.

@rryan rryan force-pushed the waveform branch 2 times, most recently from 24707ae to 394f715 Compare December 3, 2014 23:22
@rryan rryan changed the title Fix waveform concurrency issues. Fix waveform concurrency issues. Possible fix for Bug #1383404 Dec 3, 2014
* 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]),
Copy link
Member

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

@ywwg
Copy link
Member

ywwg commented Dec 4, 2014

pardon my usual ignorant questions

@rryan
Copy link
Member Author

rryan commented Dec 4, 2014

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;
Copy link
Member

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

@ywwg
Copy link
Member

ywwg commented Dec 4, 2014

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();
Copy link
Member

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()

@daschuer
Copy link
Member

daschuer commented Dec 4, 2014

Thank you for picking this up. Since this this solves an annoying bug it LGTM
You may consider my comments in a separate PR

rryan added a commit that referenced this pull request Dec 4, 2014
Fix waveform concurrency issues. Possible fix for Bug #1383404
@rryan rryan merged commit 83a5610 into mixxxdj:master Dec 4, 2014
@ywwg
Copy link
Member

ywwg commented Dec 4, 2014

🚬 ☺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants