]> git.sesse.net Git - nageru/blobdiff - nageru/decklink_output.cpp
Fix a memory leak in DecklinkOutput.
[nageru] / nageru / decklink_output.cpp
index f6826b51366e4a73afcfdcf0edac39179601a5ad..6b21edb0c45d066ebf3d8d68a6f8ed27410f4f8d 100644 (file)
@@ -248,6 +248,11 @@ void DeckLinkOutput::end_output()
                        frame_freelist.pop();
                }
        }
+
+       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)
@@ -462,12 +467,12 @@ HRESULT DeckLinkOutput::ScheduledFrameCompleted(/* in */ IDeckLinkVideoFrame *co
                ++metric_decklink_output_completed_frames_late;
                break;
        case bmdOutputFrameDropped:
-               fprintf(stderr, "Output frame was dropped (pts=%" PRId64 "ld)\n", frame->pts);
+               fprintf(stderr, "Output frame was dropped (pts=%" PRId64 ")\n", frame->pts);
                fprintf(stderr, "Consider increasing --output-buffer-frames if this persists.\n");
                ++metric_decklink_output_completed_frames_dropped;
                break;
        case bmdOutputFrameFlushed:
-               fprintf(stderr, "Output frame was flushed (pts=%" PRId64 "ld)\n", frame->pts);
+               fprintf(stderr, "Output frame was flushed (pts=%" PRId64 ")\n", frame->pts);
                ++metric_decklink_output_completed_frames_flushed;
                break;
        default: