diff audio/AudioCallbackPlaySource.cpp @ 498:cd9dec2f47e8 recording

Fix suspending/resuming audio device; it wasn't suspending when playback reached the end, only when the user stopped explicitly
author Chris Cannam
date Tue, 22 Sep 2015 17:12:37 +0100
parents fdce8a452b19
children 39e94df71d24
line wrap: on
line diff
--- a/audio/AudioCallbackPlaySource.cpp	Wed Sep 16 15:16:54 2015 +0100
+++ b/audio/AudioCallbackPlaySource.cpp	Tue Sep 22 17:12:37 2015 +0100
@@ -407,6 +407,8 @@
 void
 AudioCallbackPlaySource::play(sv_frame_t startFrame)
 {
+    if (m_target) m_target->resume();
+    
     if (!m_sourceSampleRate) {
         cerr << "AudioCallbackPlaySource::play: No source sample rate available, not playing" << endl;
         return;
@@ -518,6 +520,8 @@
                        (m_lastCurrentFrame, m_sourceSampleRate).toText().c_str()));
     }
     m_lastCurrentFrame = 0;
+
+    if (m_target) m_target->suspend();
 }
 
 void