Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix BASS_StreamFree called twice for 3d audio streams. #210

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions cleo_plugins/Audio/C3DAudioStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ C3DAudioStream::C3DAudioStream(const char* filepath) : CAudioStream()
ok = true;
}

C3DAudioStream::~C3DAudioStream()
{
if (streamInternal) BASS_StreamFree(streamInternal);
}

void C3DAudioStream::Set3dPosition(const CVector& pos)
{
link = nullptr;
Expand Down
1 change: 0 additions & 1 deletion cleo_plugins/Audio/C3DAudioStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ namespace CLEO
{
public:
C3DAudioStream(const char* filepath);
virtual ~C3DAudioStream();

// overloaded actions
virtual void Set3dPosition(const CVector& pos);
Expand Down
11 changes: 10 additions & 1 deletion cleo_plugins/Audio/CSoundSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ namespace CLEO

void EnumerateBassDevices(int& total, int& enabled, int& default_device)
{
TRACE(""); // separator
TRACE("Listing audio devices:");

BASS_DEVICEINFO info;
Expand Down Expand Up @@ -63,6 +62,16 @@ namespace CLEO
{
if (initialized) return true; // already done

TRACE(""); // separator
TRACE("Initializing SoundSystem...");

auto ver = HIWORD(BASS_GetVersion());
TRACE("BASS library version is %d (required %d or newer)", ver, BASSVERSION);
if (ver < BASSVERSION)
{
SHOW_ERROR("Invalid BASS library version! Expected at least %d, found %d.", BASSVERSION, ver);
}

auto config = GetConfigFilename();
LegacyModeDefaultStreamType = (eStreamType)GetPrivateProfileInt("General", "LegacyModeDefaultStreamType", 0, config.c_str());
allowNetworkSources = GetPrivateProfileInt("General", "AllowNetworkSources", 1, config.c_str()) != 0;
Expand Down