diff --git a/app/streaming/video/ffmpeg-renderers/pacer/pacer.cpp b/app/streaming/video/ffmpeg-renderers/pacer/pacer.cpp index 9d94adfe..b7f43011 100644 --- a/app/streaming/video/ffmpeg-renderers/pacer/pacer.cpp +++ b/app/streaming/video/ffmpeg-renderers/pacer/pacer.cpp @@ -22,7 +22,14 @@ Pacer::Pacer(IFFmpegRenderer* renderer) : Pacer::~Pacer() { - drain(); + // Stop V-sync callbacks + delete m_VsyncSource; + m_VsyncSource = nullptr; + + while (!m_FrameQueue.isEmpty()) { + AVFrame* frame = m_FrameQueue.dequeue(); + av_frame_free(&frame); + } } // Called in an arbitrary thread by the IVsyncSource on V-sync @@ -140,15 +147,3 @@ void Pacer::submitFrame(AVFrame* frame) av_frame_free(&frame); } } - -void Pacer::drain() -{ - // Stop V-sync callbacks - delete m_VsyncSource; - m_VsyncSource = nullptr; - - while (!m_FrameQueue.isEmpty()) { - AVFrame* frame = m_FrameQueue.dequeue(); - av_frame_free(&frame); - } -} diff --git a/app/streaming/video/ffmpeg-renderers/pacer/pacer.h b/app/streaming/video/ffmpeg-renderers/pacer/pacer.h index 2c190cb0..6d66bff3 100644 --- a/app/streaming/video/ffmpeg-renderers/pacer/pacer.h +++ b/app/streaming/video/ffmpeg-renderers/pacer/pacer.h @@ -23,8 +23,6 @@ public: void vsyncCallback(); - void drain(); - private: QQueue m_FrameQueue; QQueue m_FrameQueueHistory;