Skip to content

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

Open
rickard-von-essen wants to merge 1 commit into
EdgeTX:mainfrom
rickard-von-essen:fix-cpn-mac-sound
Open

fix(cpn): recreate QAudioOutput per playback to fix silent preview on macOS#7516
rickard-von-essen wants to merge 1 commit into
EdgeTX:mainfrom
rickard-von-essen:fix-cpn-mac-sound

Conversation

@rickard-von-essen

Copy link
Copy Markdown

Shared QAudioOutput was created once and reused across QMediaPlayer instances. On macOS/AVFoundation, deleteLater() leaves the old player alive long enough that the new player cannot claim the same audio output, so nothing plays. Fix by creating QAudioOutput as a child of each new QMediaPlayer so it is always fresh and auto-deleted with the player.

Also fixes a memory leak: the old audioOutput had no parent and was never deleted.

Fixes #7354

… macOS

Shared QAudioOutput was created once and reused across QMediaPlayer
instances. On macOS/AVFoundation, deleteLater() leaves the old player
alive long enough that the new player cannot claim the same audio output,
so nothing plays. Fix by creating QAudioOutput as a child of each new
QMediaPlayer so it is always fresh and auto-deleted with the player.

Also fixes a memory leak: the old audioOutput had no parent and was
never deleted.

Fixes EdgeTX#7354

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5783a1f6-0d15-4320-8c45-15ed5c702d47

📥 Commits

Reviewing files that changed from the base of the PR and between 66d9e13 and 4eb0270.

📒 Files selected for processing (2)
  • companion/src/modeledit/customfunctions.cpp
  • companion/src/modeledit/customfunctions.h
💤 Files with no reviewable changes (1)
  • companion/src/modeledit/customfunctions.h
👮 Files not reviewed due to content moderation or server errors (1)
  • companion/src/modeledit/customfunctions.cpp

📝 Walkthrough

[!WARNING]

Walkthrough skipped

File diffs could not be summarized.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Companion 2.12.0 - On macOS, in Special Functions, the audio track 'preview' button has no effect

1 participant