Simplify implementation of sf::InputSoundFile::close

This commit is contained in:
Chris Thrasher 2023-11-26 22:01:29 -07:00
parent 0a1090c89d
commit 35d82b7847

View File

@ -255,17 +255,7 @@ std::uint64_t InputSoundFile::read(std::int16_t* samples, std::uint64_t maxCount
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void InputSoundFile::close() void InputSoundFile::close()
{ {
// Destroy the reader *this = {};
m_reader.reset();
// Destroy the stream if we own it
m_stream.reset();
// Reset the sound file attributes
m_sampleOffset = 0;
m_sampleCount = 0;
m_channelCount = 0;
m_sampleRate = 0;
} }
} // namespace sf } // namespace sf