AudioThumbnail painting on Linux


#1

I seem to be down with AudioThumbnails at the minute but on Linux I get some strange painting behavior. It seems that some gibberish is being painted to the screen? Here's the main waveform, no problem. Loaded from an AudioSampleBuffer:

I then apply a process to the waveform by manipulating the AudioSampleBuffer and calling this code:

void Soundfiler::setWaveform(AudioSampleBuffer buffer)
{            
    thumbnail->clear();
    thumbnail->reset(2, 44100, buffer.getNumSamples());    
    thumbnail->addBlock(0, buffer, 0, buffer.getNumSamples());
    const Range<double> newRange (0.0, thumbnail->getTotalLength());
    scrollbar->setRangeLimits (newRange);
    setRange (newRange);
    repaint();
}

The first time around it works and for a simple fade-in I get:

But if I call that exact same process again I get much different results:

Playback confirms that the same fade-in has been applied but the waveform is no longer accurate. On windows and OSX everything works fine, and the thumbnail updates as you would expect. On Linux it's a different story. Any ideas?


#2

All good now. Calling AudioBufferSample::clear() before adding the samples to it seems to have fixed the problem.