From e9e87a1c3c74e503d00e5166f91f0b4c81c66e07 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Mon, 29 Jul 2024 09:23:27 +1000 Subject: [PATCH] Avoid crashing when a OGG file is broken (thanks to @kblaschke !) Also added a name tag to Audio for logging so that it's easier to find the audio asset that's causing it --- source/base/StarAssets.cpp | 2 +- source/base/StarMixer.cpp | 83 ++++++++++++++++++++------------------ source/core/StarAudio.cpp | 21 +++++++--- source/core/StarAudio.hpp | 6 ++- 4 files changed, 66 insertions(+), 46 deletions(-) diff --git a/source/base/StarAssets.cpp b/source/base/StarAssets.cpp index a56abd8..c47b71c 100644 --- a/source/base/StarAssets.cpp +++ b/source/base/StarAssets.cpp @@ -1241,7 +1241,7 @@ shared_ptr Assets::loadImage(AssetPath const& path) const { shared_ptr Assets::loadAudio(AssetPath const& path) const { return unlockDuring([&]() { auto newData = make_shared(); - newData->audio = make_shared