-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 overview lenght. #11359
Conversation
…ed during waveform analysis.
I rebased this on top of the main branch and I can confirm that this also fixes the problem I posted about in #11280 (comment). |
src/widget/woverview.h
Outdated
double getTrackSamples() const { | ||
return m_trackSamplesControl->get(); | ||
if (m_trackLoaded) { | ||
return m_trackSamplesControl->get(); | ||
} else { | ||
return 0.0; | ||
} | ||
} |
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.
IMO this only fixes the symptom of a more complex issue. If there is no track loaded, the CO should already be 0.0
...
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.
Do you have a better solution?
The complex issue is that the track change is propagated via the Qt signal queue while the track samples control is changed instantly as an atomic.
m_trackLoaded bool ensures that the value is not used during the transition.
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.
I see, so its basically a data-race.
The problem I still have with this solution is that the waveform assumes that CO values <= 0.0
mean that no track is loaded. Or rather, it relies on the fact that that is always the case (which it isn't due to the data-race). I think it would be better to move the m_trackLoaded != nullptr
check to callers where they should actually check that.
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.
The track length is set here to an invalid value from the worker thread:
mixxx/src/engine/enginebuffer.cpp
Line 526 in ceaedb8
setTrackEndPosition(mixxx::audio::kInvalidFramePos); // Stop renderer |
in a responds from a new track loaded into the player.
The Waveform overview visualizes the track loading process. It has already the new track before the engine had evicted the old one. In this situation is guarded by the m_trackLoaded boolean.
I will add a comment.
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.
I think a outdated waveform update signal cause a paint event with these inconstant data.
@Swiftb0y done. |
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.
typo
src/widget/woverview.h
Outdated
// Ignor the value, because the engine can still have the old track | ||
// during loading |
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.
// Ignor the value, because the engine can still have the old track | |
// during loading | |
// Ignore the value, because the engine can still have the old track | |
// during loading |
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.
hmm, codespell didn't catch that
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.
I have amended the last commit
Done |
Two users confirmed this fixes #11344 so this is ready to go without a second review? |
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.
Sure
This aims to fix #11344 where the waveform overview is rendered with the wrong length.
A possible regression from #11162
mixxx-2.3.3-145-gcfcd265afd-win64.msi