Comment 22 for bug 1024621

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Hi Daniel,

Here's a fix that I've written that doesn't require separating the CueControl from the rest. The main changes are:

* CueControl had signals connected from BaseTrackPlayer. This predates the introduction of the EngineBuffer trackLoaded/trackUnloaded signals which are not emitted from the GUI thread. In this patch I remove the other signal from the GUI thread / BaseTrackPlayer and replace it with the trackLoaded/trackUnloaded signals from EngineBuffer. Using these EngineBuffer signals accomplishes the same thing that you did by making CueControl::loadTrack return a double and be called from EngineBuffer::slotTrackLoaded. trackLoaded/trackUnloaded calls are DirectConnection slotted to the CueControl and other EngineControls. Seek requests emitted by the CueControl are DirectConnection slotted to EngineBuffer::slotControlSeekAbs so the seek to the load cue happens without roundtrips through the Qt event loop.

* In EngineBuffer::slotLoadTrack I have switched the loading flag to be a QAtomicInt instead of a bool so that memory fences are used and we don't need to use a mutex. I removed the track_samples set from there.

* If a track load has been requested, in EngineBuffer::process() I set the track samples and track samplerate to 0. This avoids having to use a COT in the EngineBuffer::slotLoadTrack.

Since I can't reproduce the issue, could you please test the patch to verify whether the bug is still fixed or not? I think the patch is mostly identical in behavior but it keeps things simpler since CueControl just uses the standard signals that EngineBuffer uses.