浏览代码

decklink: Avoid sending 0x0 frame to libobs

When the mode is set to auto, the API sometimes send frames with 0x0
size. Without filtering such frames, which causes libobs to output error
messages.
Norihiro Kamae 3 年之前
父节点
当前提交
8a41c7298f
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      plugins/decklink/decklink-device-instance.cpp

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

@@ -187,6 +187,9 @@ void DeckLinkDeviceInstance::HandleVideoFrame(
 	currentFrame.height = (uint32_t)frame->GetHeight();
 	currentFrame.timestamp = timestamp;
 
+	if (currentFrame.width == 0 || currentFrame.height == 0)
+		return;
+
 	obs_source_output_video2(
 		static_cast<DeckLinkInput *>(decklink)->GetSource(),
 		&currentFrame);