diff --git a/src/core/AudioInterface.cpp b/src/core/AudioInterface.cpp index be3102ab..990f134e 100644 --- a/src/core/AudioInterface.cpp +++ b/src/core/AudioInterface.cpp @@ -318,6 +318,7 @@ struct AudioItem : MenuItem { }; struct AudioChoice : ChoiceButton { + int lastDeviceId = -1; AudioInterface *audioInterface; void onAction(EventAction &e) override { Menu *menu = gScene->createMenu(); @@ -341,8 +342,11 @@ struct AudioChoice : ChoiceButton { } } void step() override { - std::string name = audioInterface->getDeviceName(audioInterface->deviceId); - text = ellipsize(name, 24); + if (lastDeviceId != audioInterface->deviceId) { + std::string name = audioInterface->getDeviceName(audioInterface->deviceId); + text = ellipsize(name, 24); + lastDeviceId = audioInterface->deviceId; + } } };