diff options
author | André Nusser <andre.nusser@googlemail.com> | 2016-01-29 16:56:10 +0100 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2016-01-29 16:56:10 +0100 |
commit | a0fbb86a492c3f8129e358ea3eb07e32995bb973 (patch) | |
tree | 57f5e1d6d079f336c23a7f4bcd30a2d781718f2a /src | |
parent | bbdde7f2d3c25e0fdc7c9e34c6dafcc8419dab3b (diff) |
wip ...
Diffstat (limited to 'src')
-rw-r--r-- | src/audiocachefile.cc | 14 | ||||
-rw-r--r-- | src/audiocacheidmanager.cc | 14 | ||||
-rw-r--r-- | src/audiocacheidmanager.h | 2 |
3 files changed, 15 insertions, 15 deletions
diff --git a/src/audiocachefile.cc b/src/audiocachefile.cc index 0955b25..91fcecf 100644 --- a/src/audiocachefile.cc +++ b/src/audiocachefile.cc @@ -130,25 +130,25 @@ AudioCacheFile& AudioCacheFiles::getFile(const std::string& filename) { std::lock_guard<std::mutex> lock(mutex); - AudioCacheFile* cacheAudioFile = nullptr; + AudioCacheFile* cache_audio_file = nullptr; auto it = audiofiles.find(filename); if(it == audiofiles.end()) { - cacheAudioFile = new AudioCacheFile(filename, read_buffer); - audiofiles.insert(std::make_pair(filename, cacheAudioFile)); + cache_audio_file = new AudioCacheFile(filename, read_buffer); + audiofiles.insert(std::make_pair(filename, cache_audio_file)); } else { - cacheAudioFile = it->second; + cache_audio_file = it->second; } - assert(cacheAudioFile); + assert(cache_audio_file); // Increase ref count. - ++cacheAudioFile->ref; + ++cache_audio_file->ref; - return *cacheAudioFile; + return *cache_audio_file; } void AudioCacheFiles::releaseFile(const std::string& filename) diff --git a/src/audiocacheidmanager.cc b/src/audiocacheidmanager.cc index a3e16a0..444ac38 100644 --- a/src/audiocacheidmanager.cc +++ b/src/audiocacheidmanager.cc @@ -31,7 +31,7 @@ AudioCacheIDManager::~AudioCacheIDManager() { - assert(availableids.size() == id2cache.size()); // All ids should be released. + assert(available_ids.size() == id2cache.size()); // All ids should be released. } void AudioCacheIDManager::init(unsigned int capacity) @@ -39,10 +39,10 @@ void AudioCacheIDManager::init(unsigned int capacity) std::lock_guard<std::mutex> guard(mutex); id2cache.resize(capacity); - availableids.resize(capacity); + available_ids.resize(capacity); for(size_t i = 0; i < capacity; ++i) { - availableids[i] = i; + available_ids[i] = i; } } @@ -65,14 +65,14 @@ cacheid_t AudioCacheIDManager::registerID(const cache_t& cache) cacheid_t id = CACHE_NOID; - if(availableids.empty()) + if(available_ids.empty()) { return CACHE_DUMMYID; } else { - id = availableids.back(); - availableids.pop_back(); + id = available_ids.back(); + available_ids.pop_back(); } assert(id2cache[id].id == CACHE_NOID); // Make sure it is not already in use @@ -91,7 +91,7 @@ void AudioCacheIDManager::releaseID(cacheid_t id) id2cache[id].id = CACHE_NOID; - availableids.push_back(id); + available_ids.push_back(id); } void AudioCacheIDManager::disableActive() diff --git a/src/audiocacheidmanager.h b/src/audiocacheidmanager.h index 70f7ce1..7bf3169 100644 --- a/src/audiocacheidmanager.h +++ b/src/audiocacheidmanager.h @@ -89,5 +89,5 @@ protected: std::mutex mutex; std::vector<cache_t> id2cache; - std::vector<cacheid_t> availableids; + std::vector<cacheid_t> available_ids; }; |