浏览代码

decklink: Keep deckLinkConfiguration while in use

Apparently this annoying, stupid variable was leaking before the ComPtr
was added, which ironically was necessary to ensure devices worked.
After that ComPtr commit some devices stopped capturing properly.
Basically, it implies that this pointer needs to stick around while the
device is in use.

(Jim note: This was one of the most painful things I've ever had to
debug)
jp9000 3 年之前
父节点
当前提交
2f8d28f7fa
共有 2 个文件被更改,包括 1 次插入1 次删除
  1. 0 1
      plugins/decklink/decklink-device-instance.cpp
  2. 1 0
      plugins/decklink/decklink-device-instance.hpp

+ 0 - 1
plugins/decklink/decklink-device-instance.cpp

@@ -371,7 +371,6 @@ bool DeckLinkDeviceInstance::StartCapture(DeckLinkDeviceMode *mode_,
 	if (!device->GetInput(&input))
 	if (!device->GetInput(&input))
 		return false;
 		return false;
 
 
-	ComPtr<IDeckLinkConfiguration> deckLinkConfiguration;
 	HRESULT result = input->QueryInterface(IID_IDeckLinkConfiguration,
 	HRESULT result = input->QueryInterface(IID_IDeckLinkConfiguration,
 					       (void **)&deckLinkConfiguration);
 					       (void **)&deckLinkConfiguration);
 	if (result != S_OK) {
 	if (result != S_OK) {

+ 1 - 0
plugins/decklink/decklink-device-instance.hpp

@@ -13,6 +13,7 @@ class DecklinkBase;
 
 
 class DeckLinkDeviceInstance : public IDeckLinkInputCallback {
 class DeckLinkDeviceInstance : public IDeckLinkInputCallback {
 protected:
 protected:
+	ComPtr<IDeckLinkConfiguration> deckLinkConfiguration;
 	struct obs_source_frame2 currentFrame;
 	struct obs_source_frame2 currentFrame;
 	struct obs_source_audio currentPacket;
 	struct obs_source_audio currentPacket;
 	struct obs_source_cea_708 currentCaptions;
 	struct obs_source_cea_708 currentCaptions;