1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-31 15:15:40 +00:00

Merge branch 'sound_cleanup' into 'master'

Sound cleanup

See merge request OpenMW/openmw!567
This commit is contained in:
psi29a 2021-03-22 21:42:01 +00:00
commit 1af50b7e23
3 changed files with 5 additions and 10 deletions

View file

@ -69,15 +69,13 @@ namespace MWSound
FFmpeg_Decoder& operator=(const FFmpeg_Decoder &rhs);
FFmpeg_Decoder(const FFmpeg_Decoder &rhs);
FFmpeg_Decoder(const VFS::Manager* vfs);
public:
explicit FFmpeg_Decoder(const VFS::Manager* vfs);
virtual ~FFmpeg_Decoder();
friend class SoundManager;
};
#ifndef DEFAULT_DECODER
#define DEFAULT_DECODER (::MWSound::FFmpeg_Decoder)
#endif
}
#endif

View file

@ -98,9 +98,6 @@ namespace MWSound
OpenAL_Output(SoundManager &mgr);
virtual ~OpenAL_Output();
};
#ifndef DEFAULT_OUTPUT
#define DEFAULT_OUTPUT(x) ::MWSound::OpenAL_Output((x))
#endif
}
#endif

View file

@ -54,7 +54,7 @@ namespace MWSound
SoundManager::SoundManager(const VFS::Manager* vfs, bool useSound)
: mVFS(vfs)
, mOutput(new DEFAULT_OUTPUT(*this))
, mOutput(new OpenAL_Output(*this))
, mWaterSoundUpdater(makeWaterSoundUpdaterSettings())
, mSoundBuffers(*vfs, *mOutput)
, mListenerUnderwater(false)
@ -109,7 +109,7 @@ namespace MWSound
SoundManager::~SoundManager()
{
clear();
SoundManager::clear();
mSoundBuffers.clear();
mOutput.reset();
}
@ -117,7 +117,7 @@ namespace MWSound
// Return a new decoder instance, used as needed by the output implementations
DecoderPtr SoundManager::getDecoder()
{
return DecoderPtr(new DEFAULT_DECODER (mVFS));
return std::make_shared<FFmpeg_Decoder>(mVFS);
}
DecoderPtr SoundManager::loadVoice(const std::string &voicefile)