RTSP-Client-iOS icon indicating copy to clipboard operation
RTSP-Client-iOS copied to clipboard

Memory Leak Problem

Open bidiko opened this issue 8 years ago • 3 comments

Hi,

The application does consume more memory in every loop, how can I solve this problem?

Thanks

bidiko avatar Sep 21 '17 07:09 bidiko

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 avatar Oct 13 '17 12:10 InstaRobot

@InstaRobot This doesn't solve the per-frame leak that @bidiko brings up, though -- any thoughts on that?

bredfield avatar Jul 30 '18 19:07 bredfield

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.

santa010 avatar Dec 05 '19 10:12 santa010