From 3e297b2beb2e7006aff1a2f377ce89b22cfe776d Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 2 Oct 2021 16:12:31 +0200 Subject: [PATCH] Fix mode-switching on output cards. --- nageru/decklink_output.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/nageru/decklink_output.cpp b/nageru/decklink_output.cpp index 5cf3abf..7cd9ef8 100644 --- a/nageru/decklink_output.cpp +++ b/nageru/decklink_output.cpp @@ -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 &input_frames, int64_t pts, int64_t duration) -- 2.39.2