From: David Edmundson Date: Thu, 26 Jun 2025 13:50:27 +0000 (+0100) Subject: [PATCH] Adjust timers from the correct thread X-Git-Tag: archive/raspbian/6.3.6-1+rpi1^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=321a553a6476f04163e1d5a67c2d15c8759285b7;p=kpipewire.git [PATCH] Adjust timers from the correct thread PipeWireBaseEncodedStream moves the PipeWireProduce into another thread. It is therefore it's responsiblity to ensure that any calls into PipeWireProduce are run in the correct thread. This addresses a warning about timers. Gbp-Pq: Name upstream_9fe7a568_Adjust-timers-from-the-correct-thread.patch --- diff --git a/src/pipewirebaseencodedstream.cpp b/src/pipewirebaseencodedstream.cpp index de51a90..b17ee1b 100644 --- a/src/pipewirebaseencodedstream.cpp +++ b/src/pipewirebaseencodedstream.cpp @@ -103,9 +103,13 @@ void PipeWireBaseEncodedStream::setMaxFramerate(const Fraction &framerate) } d->m_maxFramerate = framerate; - if (d->m_produce) { - d->m_produce->setMaxFramerate(d->m_maxFramerate); - } + // produce runs in another thread + QMetaObject::invokeMethod( + d->m_produce.get(), + [produce = d->m_produce.get(), framerate]() { + produce->setMaxFramerate(framerate); + }, + Qt::QueuedConnection); Q_EMIT maxFramerateChanged(); }