diff --git a/src/output/Control.hxx b/src/output/Control.hxx index 4d699fb3b..9b9996a87 100644 --- a/src/output/Control.hxx +++ b/src/output/Control.hxx @@ -269,8 +269,8 @@ public: AudioOutputControl &operator=(const AudioOutputControl &) = delete; [[gnu::pure]] - const char *GetName() const noexcept { - return name.c_str(); + const auto &GetName() const noexcept { + return name; } [[gnu::pure]] diff --git a/src/output/MultipleOutputs.cxx b/src/output/MultipleOutputs.cxx index 5b97bddab..ddb577915 100644 --- a/src/output/MultipleOutputs.cxx +++ b/src/output/MultipleOutputs.cxx @@ -100,7 +100,8 @@ MultipleOutputs::Configure(EventLoop &event_loop, EventLoop &rt_event_loop, &filter_factory); if (HasName(output->GetName())) throw FormatRuntimeError("output devices with identical " - "names: %s", output->GetName()); + "names: %s", + output->GetName().c_str()); outputs.emplace_back(std::move(output)); }); diff --git a/src/output/Thread.cxx b/src/output/Thread.cxx index e19b66130..bbc370b7b 100644 --- a/src/output/Thread.cxx +++ b/src/output/Thread.cxx @@ -421,7 +421,7 @@ AudioOutputControl::InternalDrain() noexcept void AudioOutputControl::Task() noexcept { - FormatThreadName("output:%s", GetName()); + FormatThreadName("output:%s", GetName().c_str()); try { SetThreadRealtime();