fix(cpn): recreate QAudioOutput per playback to fix silent preview on macOS (#7516)

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rickard von Essen
2026-08-28 19:29:58 +10:00
committed by GitHub
co-authored by Claude Sonnet 4.6
parent bf3137efff
commit 02432d4811
2 changed files with 1 additions and 3 deletions
+1 -2
View File
@@ -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")));
@@ -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;