X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=fake_capture.cpp;h=29b06b100d016d49543114c0056a6c31e4bf05dd;hb=1833f747a9008f38e5597622f2e3dbce3340e2cb;hp=fbcfeddbf14bffc9b020a41772db44eb0e629561;hpb=9053593313b47bd5fd6b888bec9809bf4aacc8a9;p=bmusb diff --git a/fake_capture.cpp b/fake_capture.cpp index fbcfedd..29b06b1 100644 --- a/fake_capture.cpp +++ b/fake_capture.cpp @@ -4,6 +4,7 @@ #include "bmusb/fake_capture.h" #include +#include #include #include #include @@ -89,7 +90,7 @@ void memset4(uint8_t *s, const uint8_t c[4], size_t n) } // namespace FakeCapture::FakeCapture(unsigned width, unsigned height, unsigned fps, unsigned audio_sample_frequency, int card_index, bool has_audio) - : width(width), height(height), fps(fps), audio_sample_frequency(audio_sample_frequency) + : width(width), height(height), fps(fps), audio_sample_frequency(audio_sample_frequency), card_index(card_index) { char buf[256]; snprintf(buf, sizeof(buf), "Fake card %d", card_index + 1); @@ -201,6 +202,10 @@ bool timespec_less_than(const timespec &a, const timespec &b) void FakeCapture::producer_thread_func() { + char thread_name[16]; + snprintf(thread_name, sizeof(thread_name), "FakeCapture_%d", card_index); + pthread_setname_np(pthread_self(), thread_name); + uint16_t timecode = 0; if (has_dequeue_callbacks) {