Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
tillt committed Jun 26, 2024
1 parent 3d3a4d8 commit df11ead
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions PlayEm.xcodeproj/xcshareddata/xcschemes/PlayEm.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
debugServiceExtension = "internal"
enableGPUFrameCaptureMode = "1"
enableGPUValidationMode = "1"
showGraphicsOverview = "Yes"
allowLocationSimulation = "NO">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
2 changes: 1 addition & 1 deletion PlayEm/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<key>CFBundleShortVersionString</key>
<string>1.3</string>
<key>CFBundleVersion</key>
<string>6792</string>
<string>6794</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.music</string>
<key>LSMinimumSystemVersion</key>
Expand Down
17 changes: 8 additions & 9 deletions PlayEm/Window & ViewControllers/WaveWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,13 @@ - (void)renderCallback:(CADisplayLink *)sender

++counter;

// dispatch_async(_displayLinkQueue, ^{

AVAudioFramePosition delta = self.audioController.latency + [self.audioController frameCountDeltaWithTimeDelta:sender.duration];
AVAudioFramePosition frame = self.audioController.currentFrame >= delta ? self.audioController.currentFrame - delta : self.audioController.currentFrame;
// Add the delay until the video gets visible to the playhead position for compensation
//
[self updateScopeFrame:frame];
// Substract the latency introduced by the output device setup to compensate and get
// video in sync with audible audio.
AVAudioFramePosition delta = self.audioController.latency;
AVAudioFramePosition frame = self.audioController.currentFrame >= delta ? self.audioController.currentFrame + delta : self.audioController.currentFrame;
// Add the delay until the video gets visible to the playhead position for compensation.
frame += [self.audioController frameCountDeltaWithTimeDelta:sender.duration];

// AVAudioFramePosition frame = _audioController.currentFrame >= _audioController.latency ? _audioController.currentFrame - _audioController.latency : _audioController.currentFrame;
// frame += [self.audioController frameCountDeltaWithTimeDelta:sender.duration];
os_signpost_interval_begin(pointsOfInterest, POISetCurrentFrame, "SetCurrentFrame");
self.currentFrame = frame;
os_signpost_interval_end(pointsOfInterest, POISetCurrentFrame, "SetCurrentFrame");
Expand Down Expand Up @@ -1494,6 +1491,8 @@ - (void)setBPM:(float)bpm

- (void)setCurrentFrame:(unsigned long long)frame
{
[self updateScopeFrame:frame];

if (_waveView.currentFrame == frame) {
return;
}
Expand Down

0 comments on commit df11ead

Please sign in to comment.