summaryrefslogtreecommitdiff
path: root/src/audiocache.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2017-04-01 15:30:23 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2017-04-01 21:00:39 +0200
commit9774762dd014bed4f4e3c4ac142a7b9634944fe4 (patch)
tree684d1587b8a2ac2e1a9b7bd195090743cba4f74b /src/audiocache.cc
parent32ad5ff14a03cdf049903523603c6b7a83dd7a5a (diff)
Update underrun counter directly in AudioCache.
Diffstat (limited to 'src/audiocache.cc')
-rw-r--r--src/audiocache.cc17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/audiocache.cc b/src/audiocache.cc
index a366423..2deecc9 100644
--- a/src/audiocache.cc
+++ b/src/audiocache.cc
@@ -37,6 +37,11 @@
#define CHUNKSIZE(x) (x * CHUNK_MULTIPLIER)
+AudioCache::AudioCache(Settings& settings)
+ : settings(settings)
+{
+}
+
AudioCache::~AudioCache()
{
DEBUG(cache, "~AudioCache() pre\n");
@@ -190,7 +195,7 @@ sample_t* AudioCache::next(cacheid_t id, size_t& size)
if(!c.ready)
{
// Just return silence.
- ++number_of_underruns;
+ settings.number_of_underruns.fetch_add(1);
return nodata;
}
@@ -285,13 +290,3 @@ bool AudioCache::isAsyncMode() const
{
return event_handler.isThreaded();
}
-
-size_t AudioCache::getNumberOfUnderruns() const
-{
- return number_of_underruns;
-}
-
-void AudioCache::resetNumberOfUnderruns()
-{
- number_of_underruns = 0;
-}