}
if (num_usb_devices > 0) {
+ has_bmusb_thread = true;
BMUSBCapture::start_bm_thread();
}
{
resource_pool->release_glsl_program(cbcr_program_num);
glDeleteBuffers(1, &cbcr_vbo);
- BMUSBCapture::stop_bm_thread();
+ if (has_bmusb_thread) {
+ BMUSBCapture::stop_bm_thread();
+ }
for (unsigned card_index = 0; card_index < num_cards; ++card_index) {
{
int64_t pts_int = 0; // In TIMEBASE units.
std::mutex bmusb_mutex;
+ bool has_bmusb_thread = false;
struct CaptureCard {
CaptureInterface *capture;
std::unique_ptr<PBOFrameAllocator> frame_allocator;