changeset 609:96b605673585

Fix failure to call updateModel() ever again after no frames available
author Chris Cannam
date Wed, 08 Aug 2018 15:17:36 +0100
parents 523dc97f027d
children 5ddcbc55b6a2
files audio/AudioCallbackRecordTarget.cpp
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/audio/AudioCallbackRecordTarget.cpp	Wed Jul 04 16:05:56 2018 +0100
+++ b/audio/AudioCallbackRecordTarget.cpp	Wed Aug 08 15:17:36 2018 +0100
@@ -22,6 +22,10 @@
 #include <QDir>
 #include <QTimer>
 
+//#define DEBUG_AUDIO_CALLBACK_RECORD_TARGET 1
+
+static const int recordUpdateTimeout = 200; // ms
+
 AudioCallbackRecordTarget::AudioCallbackRecordTarget(ViewManagerBase *manager,
                                                      QString clientName) :
     m_viewManager(manager),
@@ -149,6 +153,12 @@
     }
 
     if (nframes == 0) {
+#ifdef DEBUG_AUDIO_CALLBACK_RECORD_TARGET
+        cerr << "AudioCallbackRecordTarget::updateModel: no frames available" << endl;
+#endif 
+        if (m_recording) {
+            QTimer::singleShot(recordUpdateTimeout, this, SLOT(updateModel()));
+        }    
         return;
     }