From: Steinar H. Gunderson Date: Sat, 2 Oct 2021 14:12:31 +0000 (+0200) Subject: Fix mode-switching on output cards. X-Git-Tag: 2.1.0~7 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=3e297b2beb2e7006aff1a2f377ce89b22cfe776d Fix mode-switching on output cards. --- 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)