Skip to content

Commit

Permalink
Fix highPassFilterRenderCallback callback (#2544)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielebogo authored Dec 13, 2024
2 parents 3eb94d9 + fd6c227 commit 6d8a665
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions podcasts/DefaultPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -519,14 +519,13 @@ class DefaultPlayer: PlaybackProtocol, Hashable {
}

let highPassFilterRenderCallback: AURenderCallback = { inRefCon, _, inTimeStamp, _, inNumberFrames, ioData -> OSStatus in
let referenceToSelf: DefaultPlayer
if FeatureFlag.defaultPlayerFilterCallbackFix.enabled {
let reference = Unmanaged<DefaultPlayer>.fromOpaque(inRefCon)
referenceToSelf = reference.takeUnretainedValue()
} else {
referenceToSelf = unsafeBitCast(inRefCon, to: DefaultPlayer.self)
guard
let referenceToSelf = DefaultPlayer.unretainedDefaultPlayer(for: inRefCon),
let peakLimiter = referenceToSelf.peakLimiter,
let ioData = ioData
else {
return -1
}
guard let peakLimiter = referenceToSelf.peakLimiter, let ioData = ioData else { return -1 }

var audioTimeStamp = AudioTimeStamp()
audioTimeStamp.mSampleTime = inTimeStamp.pointee.mSampleTime
Expand Down

0 comments on commit 6d8a665

Please sign in to comment.