diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-02-19 18:58:05 +1100 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-02-19 18:58:05 +1100 |
commit | 50d7386bbbf6b712f007789c7858aa95b83fda92 (patch) | |
tree | e9acae10888092629cad5caf632a97020ca87360 /source/core/StarAudio.cpp | |
parent | e097e3e8e31ae8d7db9b2a75d64ffcc791c99100 (diff) |
Update StarAudio.cpp
Diffstat (limited to 'source/core/StarAudio.cpp')
-rw-r--r-- | source/core/StarAudio.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/core/StarAudio.cpp b/source/core/StarAudio.cpp index 2af4830..b7da773 100644 --- a/source/core/StarAudio.cpp +++ b/source/core/StarAudio.cpp @@ -540,14 +540,15 @@ Audio::Audio(Audio&& audio) { Audio& Audio::operator=(Audio const& audio) { if (audio.m_uncompressed) { m_uncompressed = make_shared<UncompressedAudioImpl>(*audio.m_uncompressed); - m_uncompressed->open(); + if (!m_uncompressed->open()) + throw AudioException("Failed to open uncompressed audio stream during copy"); } else { m_compressed = make_shared<CompressedAudioImpl>(*audio.m_compressed); - if (!m_compressed->open()) // Check the return value + if (!m_compressed->open()) throw AudioException("Failed to open compressed audio stream during copy"); - seekSample(audio.currentSample()); // Only seek after successful open } + seekSample(audio.currentSample()); return *this; } |