[Interest] is it ok to push audio on a background thread, not a timer?

Thiago Macieira thiago.macieira at intel.com
Mon May 18 01:27:40 CEST 2020


On domingo, 17 de maio de 2020 16:10:08 PDT David M. Cotter wrote:
> i have a cross platform (mac / win) app that plays audio.
> i'm using the push method for audio PCM
> instead of using a timer, i'm just running the pump on a background thread.
> 
> This works fine on mac, but produces silence on windows.
> 
> is this... a limitation?

No, it's a bug in your code.

Like every QObject class, unless noted otherwise, you may not call methods on 
the object from outside the object's thread of affinity (the one it was 
created in or moved to with moveToThread). Your code is abusing the API in 
both cases if you're using the API from another thread.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products





More information about the Interest mailing list