changeset 765:eae885290abc

Profiling points and comment
author Chris Cannam
date Thu, 14 May 2020 16:38:37 +0100
parents 4c91c95e146a
children cf4e0f3c2406
files audio/AudioCallbackPlaySource.cpp audio/AudioCallbackPlaySource.h
diffstat 2 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/audio/AudioCallbackPlaySource.cpp	Wed May 13 14:10:58 2020 +0100
+++ b/audio/AudioCallbackPlaySource.cpp	Thu May 14 16:38:37 2020 +0100
@@ -171,6 +171,8 @@
 {
     if (m_models.find(modelId) != m_models.end()) return;
 
+    Profiler profiler("AudioCallbackPlaySource::addModel");
+    
     bool willPlay = m_audioGenerator->addModel(modelId);
 
     auto model = ModelById::get(modelId);
@@ -200,7 +202,7 @@
     if (m_sourceSampleRate == 0) {
 
         SVDEBUG << "AudioCallbackPlaySource::addModel: Source rate changing from 0 to "
-            << model->getSampleRate() << endl;
+                << model->getSampleRate() << endl;
 
         m_sourceSampleRate = model->getSampleRate();
         srChanged = true;
@@ -332,6 +334,8 @@
     auto model = ModelById::get(modelId);
     if (!model) return;
     
+    Profiler profiler("AudioCallbackPlaySource::removeModel");
+
     m_mutex.lock();
 
 #ifdef DEBUG_AUDIO_PLAY_SOURCE
@@ -885,6 +889,8 @@
 void
 AudioCallbackPlaySource::rebuildRangeLists()
 {
+    Profiler profiler("AudioCallbackPlaySource::rebuildRangeLists");
+    
     bool constrained = (m_viewManager->getPlaySelectionMode());
 
     m_rangeStarts.clear();
--- a/audio/AudioCallbackPlaySource.h	Wed May 13 14:10:58 2020 +0100
+++ b/audio/AudioCallbackPlaySource.h	Thu May 14 16:38:37 2020 +0100
@@ -399,8 +399,7 @@
     void clearRingBuffers(bool haveLock = false, int count = 0);
     void unifyRingBuffers();
 
-    // Called from fill thread, m_playing true, mutex held
-    // Return true if work done
+    // Called from fill thread, mutex held.  Return true if work done
     bool fillBuffers();
     
     // Called from fillBuffers.  Return the number of frames written,