This basically registers the CA AudioEngine to OS notifications for device changes. Whenever the List of AudioDevices changes we reopen our CoreAudio Output Device (with last used format parameters). Our OpenCoreAudio method has an automated fallback to the OSX default output device. In case our current Output device vanishes we will be routed to the next OSX default output device.
This fixes the following behaviour (tested/reproduced by users and me):
1. OSX -> HDMI -> AVR -> HDMI -> TV
a. in this Constellation when turning off the TV our audio device will vanish. Without this fix - Audio output vanishes until a makestream was called with different format then before (mostly users just restarted XBMC for getting audio back)
When using default output and attachng a bluetooth headset or earphnes there was no automatic switch to it (osx uses these kind of audiooutputs as default automatically). A stream had to bestarted for switching to the headset/earphones
When using refreshrate adaption and pass through - on my hack audio just vanished and video stuttered (i had to select different audiostream for getting audio back).
With this PR all of those 3 issues are solved. Transition/reopen between/of devices even works when streams are played.
I consider this Frodo 12.1 food
@davilla and @huceke to comment (no - its not a hammer imo!)
[AE/CA] - on device change reinit coreaudio by calling opencoreaudio …
…with the last engine parameters (this will fallback to default device when our current output device vanishes and on the other hand will go back to that device if it re-appears).
[AE/CA] - revert 7e64331 - not needed anymore
ok to me.
Fixes trac ticket http://trac.xbmc.org/ticket/13407
do it :)
Did not fix http://trac.xbmc.org/ticket/13407 for me, new debug log is attached there. The ticket should be reopened.