Skip to content

Commit

Permalink
Fixes audio in combination with VL.Audio not working
Browse files Browse the repository at this point in the history
In case no audio frame can be delivered the sink expects to receive null.
  • Loading branch information
azeno committed Mar 22, 2024
1 parent 0deeb33 commit 9ed8bc5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion deployment/VL.IO.NDI.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>VL.IO.NDI</id>
<version>0.5.1-preview</version>
<version>0.5.2-preview</version>
<title>VL.IO.NDI</title>
<authors>vvvv, Matthias Husinsky, sebl, NewTek</authors>
<owners>vvvv, Matthias Husinsky, sebl, NewTek</owners>
Expand Down
4 changes: 2 additions & 2 deletions src/Synchronizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ IResourceProvider<AudioFrame> 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);
Expand All @@ -70,7 +70,7 @@ IResourceProvider<AudioFrame> 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);
Expand Down
6 changes: 3 additions & 3 deletions src/VL.IO.NDI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<!-- Startup properties -->
<PackageRepositories>$(MsBuildThisFileDirectory)..\..</PackageRepositories>
<VLVersion>2022.5.0-0414-g401adde02c</VLVersion>
<PackageRepositories>$([System.IO.Path]::GetFullPath('$(MsBuildThisFileDirectory)..\..'))</PackageRepositories>
<VVVVVersion>5.2</VVVVVersion>

<Version>0.5.0</Version>
<Authors>NewTek, Motzi, sebl, vvvv group</Authors>
Expand All @@ -22,7 +22,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="VL.Core" Version="2022.5.0-0414-g401adde02c" />
<PackageReference Include="VL.Core" Version="2023.5.2" />
</ItemGroup>

</Project>

0 comments on commit 9ed8bc5

Please sign in to comment.