瀏覽代碼

decklink: Fix issues showing older devices

Certain older devices (such as the Decklink Duo and Quad) could not be
selected due to the fact that they rely on BMDDeckLinkTopologicalID for
their unique identifier rather than BMDDeckLinkPersistentID.

See http://forum.blackmagicdesign.com/viewtopic.php?f=12&t=33967

Closes jp9000/obs-studio#517
pantonvich 9 年之前
父節點
當前提交
58b108b261
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      plugins/decklink/decklink-device.cpp

+ 6 - 1
plugins/decklink/decklink-device.cpp

@@ -72,8 +72,13 @@ bool DeckLinkDevice::Init()
 	if (result != S_OK)
 		return true;
 
+	/* http://forum.blackmagicdesign.com/viewtopic.php?f=12&t=33967
+	 * BMDDeckLinkTopologicalID for older devices
+	 * BMDDeckLinkPersistentID for newer ones */
+
 	int64_t value;
-	if (attributes->GetInt(BMDDeckLinkPersistentID, &value) != S_OK)
+	if (attributes->GetInt(BMDDeckLinkPersistentID,  &value) != S_OK &&
+	    attributes->GetInt(BMDDeckLinkTopologicalID, &value) != S_OK)
 		return true;
 
 	std::ostringstream os;