RTSP-Client-iOS
RTSP-Client-iOS copied to clipboard
Memory Leak Problem
Hi,
The application does consume more memory in every loop, how can I solve this problem?
Thanks
viewDidLoad() >>>
if self.video == nil {
video = RTSPPlayer(video: rtsp, usesTcp: true)
}
on close event for viewController set:
self.dismiss(animated: true) {
if self.timer != nil {
self.timer?.invalidate()
self.timer = nil
}
self.video = nil
}
It helps for closing stream thread
@InstaRobot This doesn't solve the per-frame leak that @bidiko brings up, though -- any thoughts on that?
There seems to be a problem with the AVPacket packet inside the RTSPPlayer.m, more specifically inside the stepFrame function. I found that if you re not using audio, putting av_free_packet(&packet); after the while loop seems to do the trick.