]> git.sesse.net Git - nageru/commitdiff
Fix mode-switching on output cards.
authorSteinar H. Gunderson <steinar+nageru@gunderson.no>
Sat, 2 Oct 2021 14:12:31 +0000 (16:12 +0200)
committerSteinar H. Gunderson <steinar+nageru@gunderson.no>
Sat, 2 Oct 2021 14:12:31 +0000 (16:12 +0200)
nageru/decklink_output.cpp

index 5cf3abf5f391f6c301e51f6378256aad87cae8a4..7cd9ef88f8be85abd41714e620c306dfe101e9f2 100644 (file)
@@ -82,6 +82,13 @@ DeckLinkOutput::DeckLinkOutput(ResourcePool *resource_pool, QSurface *surface, u
        });
 }
 
+DeckLinkOutput::~DeckLinkOutput()
+{
+       if (output != nullptr) {
+               output->Release();
+       }
+}
+
 bool DeckLinkOutput::set_device(IDeckLink *decklink, IDeckLinkInput *input_arg)
 {
        input = input_arg;
@@ -263,10 +270,6 @@ void DeckLinkOutput::end_output()
                input->Release();
                input = nullptr;
        }
-       if (output != nullptr) {
-               output->Release();
-               output = nullptr;
-       }
 }
 
 void DeckLinkOutput::send_frame(GLuint y_tex, GLuint cbcr_tex, YCbCrLumaCoefficients output_ycbcr_coefficients, const vector<RefCountedFrame> &input_frames, int64_t pts, int64_t duration)