]> git.sesse.net Git - nageru/blobdiff - alsa_pool.cpp
Support audio-only FFmpeg inputs. Somewhat wonky, though.
[nageru] / alsa_pool.cpp
index 1c9c4d389a46fc5246a4693439fd9f09b77bfdfb..3092dc32335551deed1b2b7b2255c07b7e9a19db 100644 (file)
@@ -199,7 +199,7 @@ ALSAPool::ProbeResult ALSAPool::probe_device_once(unsigned card_index, unsigned
        }
        if (err < 0) {
                // Not available for capture.
-               printf("%s: Not available for capture. %d\n", address, err);
+               printf("%s: Not available for capture.\n", address);
                return ALSAPool::ProbeResult::DEFER;
        }
 
@@ -391,6 +391,10 @@ void ALSAPool::reset_device(unsigned index)
 {
        lock_guard<mutex> lock(mu);
        Device *device = &devices[index];
+       if (device->state == Device::State::DEAD) {
+               // Not running, and should not be started.
+               return;
+       }
        if (inputs[index] != nullptr) {
                inputs[index]->stop_capture_thread();
        }