Skip to content

Only set kAudioFormatFlagIsAlignedHigh when applicable#915

Merged
sbooth merged 2 commits into
mainfrom
flac-procfmt
May 24, 2026
Merged

Only set kAudioFormatFlagIsAlignedHigh when applicable#915
sbooth merged 2 commits into
mainfrom
flac-procfmt

Conversation

@sbooth
Copy link
Copy Markdown
Owner

@sbooth sbooth commented May 24, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 24, 2026 15:27
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-format v22.1.6

Click here for the full clang-format patch
diff --git a/Sources/CSFBAudioEngine/Decoders/SFBFLACDecoder.mm b/Sources/CSFBAudioEngine/Decoders/SFBFLACDecoder.mm
index 6f027ea..62a4d40 100644
--- a/Sources/CSFBAudioEngine/Decoders/SFBFLACDecoder.mm
+++ b/Sources/CSFBAudioEngine/Decoders/SFBFLACDecoder.mm
@@ -298,2 +298,2 @@ void errorCallback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorS
-    processingStreamDescription.mFormatFlags = kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsSignedInteger |
-                                               kAudioFormatFlagIsNonInterleaved;
+    processingStreamDescription.mFormatFlags =
+            kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsNonInterleaved;
@@ -305 +304,0 @@ void errorCallback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorS
-

Have any feedback or feature suggestions? Share it here.

Comment thread Sources/CSFBAudioEngine/Decoders/SFBFLACDecoder.mm Outdated
Comment thread Sources/CSFBAudioEngine/Decoders/SFBFLACDecoder.mm Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts the FLAC decoder’s Linear PCM AudioStreamBasicDescription flags so kAudioFormatFlagIsAlignedHigh is only set when the decoded samples are actually stored high-aligned in a 32-bit container, matching the decoder’s sample-shifting behavior.

Changes:

  • Stop unconditionally setting kAudioFormatFlagIsAlignedHigh for FLAC processing output.
  • Conditionally add kAudioFormatFlagIsAlignedHigh only when _streamInfo.bits_per_sample != 32.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions Bot dismissed their stale review May 24, 2026 15:30

outdated suggestion

@sbooth sbooth merged commit 4727db4 into main May 24, 2026
2 checks passed
@sbooth sbooth deleted the flac-procfmt branch May 24, 2026 15:33
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.

2 participants