mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-16 19:31:02 +01:00
Make visualisations not crash :-)
This commit is contained in:
parent
313daa5fd4
commit
920f7a0f3a
@ -55,10 +55,10 @@ void ProjectMVisualisation::SceneRectChanged(const QRectF &rect) {
|
||||
}
|
||||
|
||||
void ProjectMVisualisation::ConsumeBuffer(GstBuffer *buffer, GstEnginePipeline*) {
|
||||
const int samples = GST_BUFFER_SIZE(buffer) / sizeof(short);
|
||||
const int samples_per_channel = GST_BUFFER_SIZE(buffer) / sizeof(short) / 2;
|
||||
const short* data = reinterpret_cast<short*>(GST_BUFFER_DATA(buffer));
|
||||
|
||||
if (projectm_)
|
||||
projectm_->pcm()->addPCM16Data(data, samples);
|
||||
projectm_->pcm()->addPCM16Data(data, samples_per_channel);
|
||||
gst_buffer_unref(buffer);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user