]> git.sesse.net Git - nageru/commitdiff
Get rid of the ugly allocate-a-dummy-frame trick.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 4 Oct 2015 22:42:01 +0000 (00:42 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 4 Oct 2015 22:42:01 +0000 (00:42 +0200)
mixer.cpp

index a600bf933b08bf0d70b12eca68609a14a28bcbbc..db5f3a322d479a39ea63b53a188d2268807ece4e 100644 (file)
--- a/mixer.cpp
+++ b/mixer.cpp
@@ -121,14 +121,8 @@ Mixer::Mixer(QSurface *surface1, QSurface *surface2, QSurface *surface3, QSurfac
 
        for (int card_index = 0; card_index < NUM_CARDS; ++card_index) {
                cards[card_index].usb->start_bm_capture();
-       }
-
-       for (int card_index = 0; card_index < NUM_CARDS; ++card_index) {
-               bmusb_current_rendering_frame[card_index] =
-                       cards[card_index].usb->get_video_frame_allocator()->alloc_frame();
-               GLint input_tex_pbo = (GLint)(intptr_t)bmusb_current_rendering_frame[card_index].userdata;
-               input[card_index]->set_pixel_data(0, nullptr, input_tex_pbo);
-               input[card_index]->set_pixel_data(1, nullptr, input_tex_pbo);
+               input[card_index]->set_pixel_data(0, nullptr, 0);
+               input[card_index]->set_pixel_data(1, nullptr, 0);
        }
 
        //chain->enable_phase_timing(true);
@@ -384,7 +378,9 @@ void Mixer::thread_func()
                        // release it when this is done rendering. (Actually, we could do
                        // it one frame earlier, but before we have a new one, there's no
                        // knowing when the current one is released.)
-                       input_frames_to_release.push_back(bmusb_current_rendering_frame[card_index]);
+                       if (bmusb_current_rendering_frame[card_index].owner != nullptr) {
+                               input_frames_to_release.push_back(bmusb_current_rendering_frame[card_index]);
+                       }
                        bmusb_current_rendering_frame[card_index] = card->new_frame;
                        check_error();