diff --git a/companion/src/modeledit/customfunctions.cpp b/companion/src/modeledit/customfunctions.cpp index b50a0e971..1436401b9 100644 --- a/companion/src/modeledit/customfunctions.cpp +++ b/companion/src/modeledit/customfunctions.cpp @@ -31,7 +31,6 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model, functions(model ? model->customFn : generalSettings.customFn), mediaPlayerCurrent(-1), mediaPlayer(nullptr), - audioOutput(new QAudioOutput()), modelsUpdateCnt(0) { lock = true; @@ -279,7 +278,7 @@ bool CustomFunctionsPanel::playSound(int index) stopSound(mediaPlayerCurrent); mediaPlayer = new QMediaPlayer(this); - mediaPlayer->setAudioOutput(audioOutput); + mediaPlayer->setAudioOutput(new QAudioOutput(mediaPlayer)); if (functions[index].func == FuncPlaySound) mediaPlayer->setSource(QUrl(path.prepend("qrc"))); diff --git a/companion/src/modeledit/customfunctions.h b/companion/src/modeledit/customfunctions.h index e2a765fe9..47a0a4994 100644 --- a/companion/src/modeledit/customfunctions.h +++ b/companion/src/modeledit/customfunctions.h @@ -110,7 +110,6 @@ class CustomFunctionsPanel : public GenericPanel QComboBox * fswtchRepeat[CPN_MAX_SPECIAL_FUNCTIONS]; QComboBox * fswtchGVmode[CPN_MAX_SPECIAL_FUNCTIONS]; QMediaPlayer * mediaPlayer; - QAudioOutput * audioOutput; int selectedIndex; int fswCapability;