Skip to content

Commit cd2ea97

Browse files
committed
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 panda3d#428
1 parent b8ed9b1 commit cd2ea97

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

panda/src/audiotraits/openalAudioManager.cxx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,9 @@ uncache_sound(const Filename &file_name) {
534534
vfs->resolve_filename(path, get_model_path());
535535

536536
SampleCache::iterator sci = _sample_cache.find(path);
537+
if (sci == _sample_cache.end()) {
538+
sci = _sample_cache.find(file_name);
539+
}
537540
if (sci != _sample_cache.end()) {
538541
SoundData *sd = (*sci).second;
539542
if (sd->_client_count == 0) {
@@ -542,6 +545,19 @@ uncache_sound(const Filename &file_name) {
542545
delete sd;
543546
}
544547
}
548+
549+
ExpirationQueue::iterator exqi;
550+
for (exqi = _expiring_streams.begin(); exqi != _expiring_streams.end();) {
551+
SoundData *sd = (SoundData *)(*exqi);
552+
if (sd->_client_count == 0) {
553+
if (sd->_movie->get_filename() == path ||
554+
sd->_movie->get_filename() == file_name) {
555+
exqi = _expiring_streams.erase(exqi);
556+
continue;
557+
}
558+
}
559+
++exqi;
560+
}
545561
}
546562

547563
/**

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy