mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
openal: fix issues with uncache_sound not uncaching sound:
* Previously it only looked for the resolved path, but sounds are not stored with resolved path in the cache (possibly a different bug?) * It only uncached samples, not streams Fixes #428
This commit is contained in:
parent
b8ed9b1275
commit
cd2ea97b1f
@ -534,6 +534,9 @@ uncache_sound(const Filename &file_name) {
|
|||||||
vfs->resolve_filename(path, get_model_path());
|
vfs->resolve_filename(path, get_model_path());
|
||||||
|
|
||||||
SampleCache::iterator sci = _sample_cache.find(path);
|
SampleCache::iterator sci = _sample_cache.find(path);
|
||||||
|
if (sci == _sample_cache.end()) {
|
||||||
|
sci = _sample_cache.find(file_name);
|
||||||
|
}
|
||||||
if (sci != _sample_cache.end()) {
|
if (sci != _sample_cache.end()) {
|
||||||
SoundData *sd = (*sci).second;
|
SoundData *sd = (*sci).second;
|
||||||
if (sd->_client_count == 0) {
|
if (sd->_client_count == 0) {
|
||||||
@ -542,6 +545,19 @@ uncache_sound(const Filename &file_name) {
|
|||||||
delete sd;
|
delete sd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ExpirationQueue::iterator exqi;
|
||||||
|
for (exqi = _expiring_streams.begin(); exqi != _expiring_streams.end();) {
|
||||||
|
SoundData *sd = (SoundData *)(*exqi);
|
||||||
|
if (sd->_client_count == 0) {
|
||||||
|
if (sd->_movie->get_filename() == path ||
|
||||||
|
sd->_movie->get_filename() == file_name) {
|
||||||
|
exqi = _expiring_streams.erase(exqi);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
++exqi;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user