SwiftAudioPlayer icon indicating copy to clipboard operation
SwiftAudioPlayer copied to clipboard

fix (**) deallocate only when we're sure we've allocated something

Open kuamanet opened this issue 3 years ago • 6 comments

Fix #169

kuamanet avatar Sep 19 '22 09:09 kuamanet

The error is solved but if are playing from a list then its stucks on the screen and there is no crash but its stuck in the same

Sethi1998 avatar Sep 19 '22 11:09 Sethi1998

the main crash was in this line " lastDescription.deallocate()"

Sethi1998 avatar Sep 19 '22 11:09 Sethi1998

@Sethi1998 can you provide a little snippet to reproduce the error?

kuamanet avatar Sep 19 '22 12:09 kuamanet

@Sethi1998 can you provide a little snippet to reproduce the error?

there is no error if I have used your methods which you have changed

Sethi1998 avatar Sep 19 '22 12:09 Sethi1998

" if outPacketDescriptions?.pointee == nil { outPacketDescriptions?.pointee = UnsafeMutablePointer<AudioStreamPacketDescription>.allocate(capacity: 1) if let lastDescription = selfAudioConverter.converterDescriptions { lastDescription.deallocate() } } "

Sethi1998 avatar Sep 19 '22 12:09 Sethi1998

@Sethi1998 I've just tried this a few times, the queue is correctly played in iOS 16, can you explain how this is not working for you?

GabM3 avatar Sep 19 '22 12:09 GabM3