summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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);