summaryrefslogtreecommitdiff
path: root/RtAudio.cpp
diff options
context:
space:
mode:
authorStephen Sinclair <radarsat1@gmail.com>2018-12-29 15:38:02 +0100
committerStephen Sinclair <radarsat1@gmail.com>2018-12-29 15:38:17 +0100
commitf580e841ceb80c371b37f071b2db06cd6ef53486 (patch)
treea6413f90c660224623c8f31c62dfbd4689c46217 /RtAudio.cpp
parentb9468aa6f82fdea1f3dc364f477e859b39f0bb2a (diff)
Update lastTickTimestamp in startStream.
Fixes #144.
Diffstat (limited to 'RtAudio.cpp')
-rw-r--r--RtAudio.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/RtAudio.cpp b/RtAudio.cpp
index ace0572..8037d2a 100644
--- a/RtAudio.cpp
+++ b/RtAudio.cpp
@@ -1541,6 +1541,10 @@ void RtApiCore :: startStream( void )
return;
}
+ #if defined( HAVE_GETTIMEOFDAY )
+ gettimeofday( &stream_.lastTickTimestamp, NULL );
+ #endif
+
OSStatus result = noErr;
CoreHandle *handle = (CoreHandle *) stream_.apiHandle;
if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) {
@@ -2499,6 +2503,10 @@ void RtApiJack :: startStream( void )
return;
}
+ #if defined( HAVE_GETTIMEOFDAY )
+ gettimeofday( &stream_.lastTickTimestamp, NULL );
+ #endif
+
JackHandle *handle = (JackHandle *) stream_.apiHandle;
int result = jack_activate( handle->client );
if ( result ) {
@@ -3378,6 +3386,10 @@ void RtApiAsio :: startStream()
return;
}
+ #if defined( HAVE_GETTIMEOFDAY )
+ gettimeofday( &stream_.lastTickTimestamp, NULL );
+ #endif
+
AsioHandle *handle = (AsioHandle *) stream_.apiHandle;
ASIOError result = ASIOStart();
if ( result != ASE_OK ) {
@@ -4551,6 +4563,10 @@ void RtApiWasapi::startStream( void )
return;
}
+ #if defined( HAVE_GETTIMEOFDAY )
+ gettimeofday( &stream_.lastTickTimestamp, NULL );
+ #endif
+
// update stream state
stream_.state = STREAM_RUNNING;
@@ -6392,6 +6408,10 @@ void RtApiDs :: startStream()
return;
}
+ #if defined( HAVE_GETTIMEOFDAY )
+ gettimeofday( &stream_.lastTickTimestamp, NULL );
+ #endif
+
DsHandle *handle = (DsHandle *) stream_.apiHandle;
// Increase scheduler frequency on lesser windows (a side-effect of
@@ -8084,6 +8104,10 @@ void RtApiAlsa :: startStream()
MUTEX_LOCK( &stream_.mutex );
+ #if defined( HAVE_GETTIMEOFDAY )
+ gettimeofday( &stream_.lastTickTimestamp, NULL );
+ #endif
+
int result = 0;
snd_pcm_state_t state;
AlsaHandle *apiInfo = (AlsaHandle *) stream_.apiHandle;
@@ -8655,6 +8679,10 @@ void RtApiPulse::startStream( void )
MUTEX_LOCK( &stream_.mutex );
+ #if defined( HAVE_GETTIMEOFDAY )
+ gettimeofday( &stream_.lastTickTimestamp, NULL );
+ #endif
+
stream_.state = STREAM_RUNNING;
pah->runnable = true;
@@ -9639,6 +9667,10 @@ void RtApiOss :: startStream()
MUTEX_LOCK( &stream_.mutex );
+ #if defined( HAVE_GETTIMEOFDAY )
+ gettimeofday( &stream_.lastTickTimestamp, NULL );
+ #endif
+
stream_.state = STREAM_RUNNING;
// No need to do anything else here ... OSS automatically starts