Skip to content

Commit

Permalink
Added AETimeInit for setting up time routines prior to hitting audio …
Browse files Browse the repository at this point in the history
…thread
  • Loading branch information
michaeltyson committed Jun 12, 2016
1 parent be100cf commit 49e5a84
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions TheAmazingAudioEngine/Core Types/AETime.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ extern "C" {

typedef uint64_t AEHostTicks;
typedef double AESeconds;

/*!
* Initialize
*/
void AETimeInit();

/*!
* Get current global timestamp, in host ticks
Expand Down
2 changes: 1 addition & 1 deletion TheAmazingAudioEngine/Core Types/AETime.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
static double __hostTicksToSeconds = 0.0;
static double __secondsToHostTicks = 0.0;

static void AETimeInit() {
void AETimeInit() {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
mach_timebase_info_data_t tinfo;
Expand Down
2 changes: 2 additions & 0 deletions TheAmazingAudioEngine/Utilities/AEIOAudioUnit.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ - (instancetype)init {
_outputEnabled = YES;
self.renderBlockValue = [AEManagedValue new];

AETimeInit();

return self;
}

Expand Down

0 comments on commit 49e5a84

Please sign in to comment.