]> git.sesse.net Git - nageru/blobdiff - mixer.cpp
Fix crash on exit when there are no USB cards.
[nageru] / mixer.cpp
index 6276e2cb20c15b92aaaa4c70dfd00afdf0360322..94d09e7eb272441dcf1dd2dfe6dde790f0baca22 100644 (file)
--- a/mixer.cpp
+++ b/mixer.cpp
@@ -205,6 +205,7 @@ Mixer::Mixer(const QSurfaceFormat &format, unsigned num_cards)
        }
 
        if (num_usb_devices > 0) {
+               has_bmusb_thread = true;
                BMUSBCapture::start_bm_thread();
        }
 
@@ -283,7 +284,9 @@ Mixer::~Mixer()
 {
        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) {
                {