]> git.sesse.net Git - nageru/blobdiff - nageru/alsa_pool.cpp
Make the delay analyzer understand that two sources can have different starting times.
[nageru] / nageru / alsa_pool.cpp
index 978f236886256e529e448c6dbcd37c53be951bfc..c74ed26613a5a31449d7e5c9938a38dea45ec86d 100644 (file)
@@ -44,7 +44,7 @@ ALSAPool::~ALSAPool()
        const uint64_t one = 1;
        if (write(should_quit_fd, &one, sizeof(one)) != sizeof(one)) {
                perror("write(should_quit_fd)");
-               exit(1);
+               abort();
        }
        inotify_thread.join();
 
@@ -53,11 +53,13 @@ ALSAPool::~ALSAPool()
        }
 }
 
-std::vector<ALSAPool::Device> ALSAPool::get_devices()
+std::vector<ALSAPool::Device> ALSAPool::get_devices(bool hold_devices)
 {
        lock_guard<mutex> lock(mu);
-       for (Device &device : devices) {
-               device.held = true;
+       if (hold_devices) {
+               for (Device &device : devices) {
+                       device.held = true;
+               }
        }
        return devices;
 }