Skip to content

Commit 9840b17

Browse files
lock on EvalAsync
1 parent 62bfed2 commit 9840b17

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Samples/StyleTransfer/StyleTransfer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
2020
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
2121
<GenerateAppInstallerFile>True</GenerateAppInstallerFile>
22-
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
22+
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
2323
<GenerateTestArtifacts>True</GenerateTestArtifacts>
2424
<AppxBundle>Always</AppxBundle>
2525
<AppxBundlePlatforms>x64</AppxBundlePlatforms>

Samples/StyleTransfer/VideoEffect/StyleTransferEffectCpp/StyleTransferEffect.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ namespace winrt::StyleTransferEffectCpp::implementation
6868
Binding.Bind(InputImageDescription, inputFrame);
6969
Binding.Bind(OutputImageDescription, outputTransformed);
7070
auto nowEval = std::chrono::high_resolution_clock::now();
71+
std::lock_guard<mutex> guard{ Processing };
7172
evalStatus = Session.EvaluateAsync(Binding, L"test");
7273
evalStatus.Completed([&, nowEval](auto&& asyncInfo, winrt::Windows::Foundation::AsyncStatus const args) {
7374
VideoFrame output = asyncInfo.GetResults().Outputs().Lookup(OutputImageDescription).try_as<VideoFrame>();

0 commit comments

Comments
 (0)