From a5aa4eca2930a0813aef6c1373eeb2a53eaa2959 Mon Sep 17 00:00:00 2001 From: arch1t3cht Date: Mon, 31 Oct 2022 23:03:37 +0100 Subject: [PATCH] vapoursynth: Properly pass through script errors --- src/audio_provider_vs.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/audio_provider_vs.cpp b/src/audio_provider_vs.cpp index 575daaad6..37005d3c1 100644 --- a/src/audio_provider_vs.cpp +++ b/src/audio_provider_vs.cpp @@ -84,7 +84,9 @@ VapoursynthAudioProvider::VapoursynthAudioProvider(agi::fs::path const& filename num_samples = vi->numSamples; } catch (VapoursynthError const& err) { - throw agi::AudioProviderError(agi::format("Vapoursynth error: %s", err.GetMessage())); + // Unlike the video provider manager, the audio provider factory catches AudioProviderErrors and picks whichever source doesn't throw one. + // So just rethrow the Error here with an extra label so the user will see the error message and know the audio wasn't loaded with VS + throw VapoursynthError(agi::format("Vapoursynth error: %s", err.GetMessage())); } template