     fileprivate var glkView: GLKView?
     fileprivate var frameLock: NSLock?
     fileprivate var renderingEnabled: Bool = true
-    fileprivate var clearRenderer = 0
     fileprivate var lastVideoFrame: OTVideoFrame?
-    fileprivate var lastVideoFrameRendered: Bool = true
     fileprivate var displayLinkProxy: DisplayLinkProxy?
     fileprivate var displayLink: CADisplayLink?
     

        }
        frameLock?.lock()
        //Coming from bg you will double render and deallocate will crash below. Hence check for lastVideoFrameRendered == false
        guard let frame = lastVideoFrame , lastVideoFrameRendered == false
            else {
                return
        }
        
        renderer?.drawFrame(frame: frame, withViewport: view.frame)
        lastVideoFrameRendered = true
        deallocateFrame(frame)
    }
    
    func deallocateFrame(_ frame: OTVideoFrame?) -> Void {
        guard let frame = frame else {
            return
        }
        let yPlane: UnsafeMutablePointer<GLubyte>? = frame.planes?.pointer(at: 0)?.assumingMemoryBound(to: GLubyte.self)
        let uPlane: UnsafeMutablePointer<GLubyte>? = frame.planes?.pointer(at: 1)?.assumingMemoryBound(to: GLubyte.self)
        let vPlane: UnsafeMutablePointer<GLubyte>? = frame.planes?.pointer(at: 2)?.assumingMemoryBound(to: GLubyte.self)

            lastVideoFrame?.planes?.addPointer(yPlane)
            lastVideoFrame?.planes?.addPointer(uPlane)
            lastVideoFrame?.planes?.addPointer(vPlane)
    
            fLock.unlock()
            
            if let delegate = delegate {
