aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends/null.cpp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-11-28 12:51:46 +0100
committerSven Gothel <[email protected]>2023-11-28 12:51:46 +0100
commit1aaf4f070011490bcece50394b9b32dfa593fd9e (patch)
tree17d68284e401a35eea3d3a574d986d446a60763a /alc/backends/null.cpp
parent6e7cee4fa9a8af03f28ca26cd89f8357390dfc90 (diff)
parent571b546f35eead77ce109f8d4dd6c3de3199d573 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'alc/backends/null.cpp')
-rw-r--r--alc/backends/null.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/alc/backends/null.cpp b/alc/backends/null.cpp
index 5a8fc255..3c68e4ce 100644
--- a/alc/backends/null.cpp
+++ b/alc/backends/null.cpp
@@ -30,10 +30,10 @@
#include <functional>
#include <thread>
-#include "core/device.h"
+#include "althrd_setname.h"
#include "almalloc.h"
+#include "core/device.h"
#include "core/helpers.h"
-#include "threads.h"
namespace {
@@ -50,7 +50,7 @@ struct NullBackend final : public BackendBase {
int mixerProc();
- void open(const char *name) override;
+ void open(std::string_view name) override;
bool reset() override;
void start() override;
void stop() override;
@@ -105,13 +105,13 @@ int NullBackend::mixerProc()
}
-void NullBackend::open(const char *name)
+void NullBackend::open(std::string_view name)
{
- if(!name)
+ if(name.empty())
name = nullDevice;
- else if(strcmp(name, nullDevice) != 0)
- throw al::backend_exception{al::backend_error::NoDevice, "Device name \"%s\" not found",
- name};
+ else if(name != nullDevice)
+ throw al::backend_exception{al::backend_error::NoDevice, "Device name \"%.*s\" not found",
+ static_cast<int>(name.length()), name.data()};
mDevice->DeviceName = name;
}