]> git.sesse.net Git - nageru/blobdiff - nageru/alsa_pool.cpp
Don't reset an ALSA device when the only thing that changes is which channels to...
[nageru] / nageru / alsa_pool.cpp
index c74ed26613a5a31449d7e5c9938a38dea45ec86d..4e12bb75349750d57d2e2ff1b72e43a1def841ce 100644 (file)
@@ -79,6 +79,16 @@ void ALSAPool::release_device(unsigned index)
        }
 }
 
+bool ALSAPool::device_is_held(unsigned index)
+{
+       lock_guard<mutex> lock(mu);
+       if (index < devices.size()) {
+               return devices[index].held;
+       } else {
+               return false;
+       }
+}
+
 void ALSAPool::enumerate_devices()
 {
        // Enumerate all cards.