Browse Source

Update lastTickTimestamp in startStream.

Fixes #144.
tags/5.1.0
Stephen Sinclair 6 years ago
parent
commit
f580e841ce
1 changed files with 32 additions and 0 deletions
  1. +32
    -0
      RtAudio.cpp

+ 32
- 0
RtAudio.cpp View File

@@ -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


Loading…
Cancel
Save