From e4fdeefdd42900b870f2bc699450b5a9f17c0ee6 Mon Sep 17 00:00:00 2001 From: sirius Date: Sat, 28 Sep 2019 21:22:25 +0800 Subject: [PATCH] remove first two frames to forbid from interface before playback being rendered to video --- src/engine/client/video.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/engine/client/video.cpp b/src/engine/client/video.cpp index 5e41fa92a..be5f370ce 100644 --- a/src/engine/client/video.cpp +++ b/src/engine/client/video.cpp @@ -189,12 +189,17 @@ void CVideo::nextVideoFrame_thread() // CAutoreleasePool AutoreleasePool; // #endif - m_VideoStream.frame->pts = m_VideoStream.enc->frame_number; - dbg_msg("video_recorder", "vframe: %d", m_VideoStream.enc->frame_number); + if(m_VideoStream.enc->frame_number >= 2) + { + m_VideoStream.frame->pts = m_VideoStream.enc->frame_number; + dbg_msg("video_recorder", "vframe: %d", m_VideoStream.enc->frame_number); - read_rgb_from_gl(); - fill_video_frame(); - write_frame(&m_VideoStream); + read_rgb_from_gl(); + fill_video_frame(); + write_frame(&m_VideoStream); + } + else + m_VideoStream.enc->frame_number += 1; m_ProcessingVideoFrame = false; m_NextFrame = false;