[pull] master from MusicPlayerDaemon:master - #98
Merged
Conversation
Most of the code base has already been converted to "#pragma once"; this converts the remaining old-style include guards in the Apple support library.
The two-argument ThrowOSStatus() concatenated the caller-supplied prefix and the CFErrorRef description without any separator, producing messages like "Unable to open OS X componentThe operation could not be completed". Insert ": " between the two parts.
A type-safe wrapper for AudioObjectSetPropertyData() which throws on error, mirroring the existing AudioObjectGetPropertyDataT(). To be used by the osx output plugin.
Instead of hiding the macOS 12 SDK rename behind ad-hoc preprocessor macros, define the new "Main" identifiers as constexpr aliases for the old "Master" identifiers when building with an older SDK. The code can then use the current CoreAudio names directly.
Replace the manual AudioObjectSetPropertyData() calls in SetVolume() and osx_output_hog_device() with the new type-safe wrapper, removing the size/status boilerplate. The hog-mode failure message now contains the error description instead of a bare numeric OSStatus.
Throw via Apple::ThrowOSStatus() where a raw OSStatus was previously formatted as a bare number or discarded entirely: - osx_output_set_device_format() included only the numeric error code when changing the physical stream format failed - Play() threw "Unable to restart audio output after pause", which was misleading (the first start takes this path, too) and dropped the OSStatus
Replace the hand-rolled shift loop with the existing utility from util/RoundPowerOfTwo.hxx.
Replace the manual AudioObjectGetPropertyData() call with the type-safe wrapper. The behavior is unchanged: a lookup failure is still ignored and leaves dev_id as kAudioDeviceUnknown, to be resolved later by osx_output_set_device().
Nothing in this plugin uses Mutex, Cond or StringBuffer (FmtBuffer comes from lib/fmt/ToBuffer.hxx). The CoreServices umbrella header is a leftover from the pre-AudioComponent Component Manager API and is not needed by the current code.
Use meson's native framework dependency instead of raw link_args. Drop CoreServices, which is no longer used, and name AudioToolbox and CoreFoundation explicitly instead of relying on framework re-exports for AudioComponent/AudioHardwareService and CFError/ CFString.
- pass AudioStreamBasicDescription by reference to StreamDescriptionToString() - remove the unused format_string variable - use static_cast instead of a C-style cast in the render callback - compare the AudioComponent against nullptr instead of 0 - mark sample_rate [[maybe_unused]] to fix an unused-variable warning when building without ENABLE_DSD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )