From 9b655081c7c0f8c83a9e8d67f3980632595c13b4 Mon Sep 17 00:00:00 2001 From: Caner Date: Thu, 29 Jan 2026 12:40:44 +0300 Subject: [PATCH] Fix aja in not working correctly in linux & device lock issues in windows --- External/libajantv2 | 2 +- Source/AJADevice.cpp | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/External/libajantv2 b/External/libajantv2 index e6f9bac..6b8f73f 160000 --- a/External/libajantv2 +++ b/External/libajantv2 @@ -1 +1 @@ -Subproject commit e6f9bac269e5730c82f6a0873f9a1b98ed80300a +Subproject commit 6b8f73ff364c52e9ca248cb1da5a39d11444fb07 diff --git a/Source/AJADevice.cpp b/Source/AJADevice.cpp index 9963ed1..dc7da78 100644 --- a/Source/AJADevice.cpp +++ b/Source/AJADevice.cpp @@ -1071,18 +1071,20 @@ bool AJADevice::AcquireDevice() if (GetStreamingApplication(curAppFourCC, curPid)) { if (curPid == nosPid) - return true; - auto curApp = FourCCToString(curAppFourCC); - if (curPid != 0) - nosEngine.LogW("Device %s is already acquired by application %s (PID %d). Trying to reclaim it.", GetDisplayName().c_str(), curApp.c_str(), curPid); + { + auto curApp = FourCCToString(curAppFourCC); + if (curPid != 0) + nosEngine.LogW("Device %s is already acquired by application %s (PID %d). Trying to reclaim it.", GetDisplayName().c_str(), curApp.c_str(), curPid); + } } - if (!AcquireStreamForApplication(NOS_FOURCC, nosPid)) + if (!AcquireStreamForApplicationWithReference(NOS_FOURCC, nosPid)) { nosEngine.LogE("Failed to acquire device %s for Nodos.", GetDisplayName().c_str()); return false; } - nosEngine.LogD("Device %s acquired by Nodos.", GetDisplayName().c_str()); + if(nosPid != curPid) + nosEngine.LogD("Device %s acquired by Nodos.", GetDisplayName().c_str()); return true; } @@ -1106,7 +1108,7 @@ void AJADevice::ReleaseDevice() return; } - if (ReleaseStreamForApplication(NOS_FOURCC, nosPid)) + if (ReleaseStreamForApplicationWithReference(NOS_FOURCC, nosPid)) nosEngine.LogD("Device %s released by Nodos", GetDisplayName().c_str()); else nosEngine.LogE("Failed to release device %s", GetDisplayName().c_str());