From 9ed8bc54fa37a7983317ac151e9c402ad611d9cd Mon Sep 17 00:00:00 2001 From: Elias Holzer Date: Fri, 22 Mar 2024 13:46:59 +0100 Subject: [PATCH] Fixes audio in combination with VL.Audio not working In case no audio frame can be delivered the sink expects to receive null. --- deployment/VL.IO.NDI.nuspec | 2 +- src/Synchronizer.cs | 4 ++-- src/VL.IO.NDI.csproj | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/deployment/VL.IO.NDI.nuspec b/deployment/VL.IO.NDI.nuspec index 75d48ec..a22fc77 100644 --- a/deployment/VL.IO.NDI.nuspec +++ b/deployment/VL.IO.NDI.nuspec @@ -2,7 +2,7 @@ VL.IO.NDI - 0.5.1-preview + 0.5.2-preview VL.IO.NDI vvvv, Matthias Husinsky, sebl, NewTek vvvv, Matthias Husinsky, sebl, NewTek diff --git a/src/Synchronizer.cs b/src/Synchronizer.cs index 0e94f7f..07ae382 100644 --- a/src/Synchronizer.cs +++ b/src/Synchronizer.cs @@ -61,7 +61,7 @@ IResourceProvider IAudioSource.GrabAudioFrame(int sampleCount, Optio { var syncInstanceHandle = _syncInstanceProvider?.GetHandle(); if (syncInstanceHandle is null) - return ResourceProvider.Return(AudioFrame.Empty); + return null; var nativeAudioFrame = new NDIlib.audio_frame_v2_t(); NDIlib.framesync_capture_audio(syncInstanceHandle.Resource, ref nativeAudioFrame, sampleRate.Value, channelCount.Value, sampleCount); @@ -70,7 +70,7 @@ IResourceProvider IAudioSource.GrabAudioFrame(int sampleCount, Optio { NDIlib.framesync_free_audio(syncInstanceHandle.Resource, ref nativeAudioFrame); syncInstanceHandle.Dispose(); - return ResourceProvider.Return(AudioFrame.Empty); + return null; } var (bufferOwner, audioFrame) = Utils.CreateAudioFrame(ref nativeAudioFrame, interleaved.Value); diff --git a/src/VL.IO.NDI.csproj b/src/VL.IO.NDI.csproj index a05b9fe..dd8a51c 100644 --- a/src/VL.IO.NDI.csproj +++ b/src/VL.IO.NDI.csproj @@ -9,8 +9,8 @@ true - $(MsBuildThisFileDirectory)..\.. - 2022.5.0-0414-g401adde02c + $([System.IO.Path]::GetFullPath('$(MsBuildThisFileDirectory)..\..')) + 5.2 0.5.0 NewTek, Motzi, sebl, vvvv group @@ -22,7 +22,7 @@ - +