X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Falsa_input.cpp;h=f26a012d9836b250524fee8230e6beb7e1287339;hb=f81ae3be1aae619fe4ad022f55d95a4a83ace076;hp=40fba43c12a19192a0c0fdcc07f430355df88619;hpb=b280eea4c3fa09472595dd62538e036f2dbcaff5;p=nageru diff --git a/nageru/alsa_input.cpp b/nageru/alsa_input.cpp index 40fba43..f26a012 100644 --- a/nageru/alsa_input.cpp +++ b/nageru/alsa_input.cpp @@ -1,15 +1,18 @@ #include "alsa_input.h" #include +#include +#include #include +#include #include +#include #include -#include +#include #include #include "alsa_pool.h" #include "bmusb/bmusb.h" -#include "shared/timebase.h" using namespace std; using namespace std::chrono; @@ -174,6 +177,14 @@ void ALSAInput::stop_capture_thread() void ALSAInput::capture_thread_func() { + if (!done_init) { + char thread_name[16]; + snprintf(thread_name, sizeof(thread_name), "ALSA_C_%d", internal_dev_index); + pthread_setname_np(pthread_self(), thread_name); + + done_init = true; + } + parent_pool->set_card_state(internal_dev_index, ALSAPool::Device::State::STARTING); // If the device hasn't been opened already, we need to do so