]> git.sesse.net Git - nageru/blobdiff - nageru/mixer.cpp
On errors, abort() instead of exit(1); exit() in a multithreaded program just gives...
[nageru] / nageru / mixer.cpp
index 32c1984fa4c3ee89dd214695a26113c5729f554d..c91857e62fbab09b3677fcebba41402235feabc6 100644 (file)
@@ -432,7 +432,7 @@ Mixer::Mixer(const QSurfaceFormat &format, unsigned num_cards)
        for (unsigned video_card_index = 0; video_card_index < video_inputs.size(); ++card_index, ++video_card_index) {
                if (card_index >= MAX_VIDEO_CARDS) {
                        fprintf(stderr, "ERROR: Not enough card slots available for the videos the theme requested.\n");
-                       exit(1);
+                       abort();
                }
                configure_card(card_index, video_inputs[video_card_index], CardType::FFMPEG_INPUT, /*output=*/nullptr);
                video_inputs[video_card_index]->set_card_index(card_index);
@@ -445,7 +445,7 @@ Mixer::Mixer(const QSurfaceFormat &format, unsigned num_cards)
        for (unsigned html_card_index = 0; html_card_index < html_inputs.size(); ++card_index, ++html_card_index) {
                if (card_index >= MAX_VIDEO_CARDS) {
                        fprintf(stderr, "ERROR: Not enough card slots available for the HTML inputs the theme requested.\n");
-                       exit(1);
+                       abort();
                }
                configure_card(card_index, html_inputs[html_card_index], CardType::CEF_INPUT, /*output=*/nullptr);
                html_inputs[html_card_index]->set_card_index(card_index);
@@ -466,7 +466,7 @@ Mixer::Mixer(const QSurfaceFormat &format, unsigned num_cards)
                if (!v210Converter::has_hardware_support()) {
                        fprintf(stderr, "ERROR: --ten-bit-input requires support for OpenGL compute shaders\n");
                        fprintf(stderr, "       (OpenGL 4.3, or GL_ARB_compute_shader + GL_ARB_shader_image_load_store).\n");
-                       exit(1);
+                       abort();
                }
                v210_converter.reset(new v210Converter());
 
@@ -483,7 +483,7 @@ Mixer::Mixer(const QSurfaceFormat &format, unsigned num_cards)
                if (!v210Converter::has_hardware_support()) {
                        fprintf(stderr, "ERROR: --ten-bit-output requires support for OpenGL compute shaders\n");
                        fprintf(stderr, "       (OpenGL 4.3, or GL_ARB_compute_shader + GL_ARB_shader_image_load_store).\n");
-                       exit(1);
+                       abort();
                }
        }
 
@@ -998,7 +998,7 @@ void Mixer::thread_func()
        QOpenGLContext *context = create_context(mixer_surface);
        if (!make_current(context, mixer_surface)) {
                printf("oops\n");
-               exit(1);
+               abort();
        }
 
        // Start the actual capture. (We don't want to do it before we're actually ready