summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonas Suhr Christensen <jsc@umbraculum.org>2015-04-11 17:01:19 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2016-01-20 13:22:44 +0100
commitdee32d6f7f2ea70f9c67b9f1557eaa2f56fb9dc9 (patch)
tree1041658ca49ec82fca9722fcfeb5fb7674b4070d /src
parentf5ad8d9b298fb6e5f0b2f81678490fbee4376ec5 (diff)
Setting local cache in open call.
Diffstat (limited to 'src')
-rw-r--r--src/cachemanager.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cachemanager.cc b/src/cachemanager.cc
index f7fc730..9536cdf 100644
--- a/src/cachemanager.cc
+++ b/src/cachemanager.cc
@@ -61,7 +61,10 @@ void CacheManager::init(size_t poolsize)
for(size_t i = 0; i < poolsize; i++) {
localcachepos[i] = 0;
}
-
+
+ for(size_t i = 0; i < poolsize; i++) {
+ localcache[i] = NULL;
+ }
localcache.resize(poolsize);
running = true;
@@ -109,6 +112,9 @@ sample_t *CacheManager::open(AudioFile *file, size_t initial_samples_needed, int
id2cache[id] = c;
}
+ localcachepos[id] = 0;
+ localcache[id] = c.front;
+
if(initial_samples_needed < file->size) {
event_t e = createLoadNextEvent(id, c.pos, LOADNEXT);
pushEvent(e);
@@ -159,6 +165,7 @@ sample_t *CacheManager::next(cacheid_t id, size_t &size)
}
localcachepos[id] = 0;
+ localcache[id] = NULL;
const cache_t c = getNextCache(id);