Revision | 161 (tree) |
---|---|
Time | 2019-08-13 17:01:22 |
Author | toshinagata1964 |
Improve handling of the internal audio format of the music devices
@@ -670,22 +670,7 @@ | ||
670 | 670 | if (err == noErr) { |
671 | 671 | propSize = sizeof(MDAudioFormat); |
672 | 672 | err = AudioUnitGetProperty(unit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &info.format, &propSize); |
673 | - if (err) { | |
674 | - err = AudioUnitSetProperty(unit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &gAudio->preferredFormat, sizeof(AudioStreamBasicDescription)); | |
675 | - info.acceptsCanonicalFormat = 1; | |
676 | - info.format = gAudio->preferredFormat; | |
677 | - } else { | |
678 | - info.acceptsCanonicalFormat = 0; | |
679 | - } | |
680 | - | |
681 | - /* if (err != noErr) { | |
682 | - info.acceptsCanonicalFormat = 0; | |
683 | - propSize = sizeof(MDAudioFormat); | |
684 | - err = AudioUnitGetProperty(unit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &info.format, &propSize); | |
685 | - } else { | |
686 | - info.acceptsCanonicalFormat = 1; | |
687 | - info.format = gAudio->preferredFormat; | |
688 | - } */ | |
673 | + info.acceptsCanonicalFormat = sMDAudioCompareFormat(&info.format, &gAudio->preferredFormat); | |
689 | 674 | } else { |
690 | 675 | unit = NULL; |
691 | 676 | } |