Unregister it before selecting a new output/device. Register it after selecting a new output/device. (cherry picked from commit 47b50ec3)