Skip to content

Commit

Permalink
faster
Browse files Browse the repository at this point in the history
  • Loading branch information
TalusL committed Jun 19, 2024
1 parent 5305fa1 commit 6610e23
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/player/QQuickRealTimePlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,7 @@ shared_ptr<AVFrame> QQuickRealTimePlayer::getFrame(bool &got) {
// 缓冲区出队被渲染的帧
videoFrameQueue.pop();
}
// 计算一帧的显示时间
auto frameDuration = 1000 / decoder->GetFps();
// 缓冲,追帧机制
if (videoFrameQueue.size() < 5) {
double scale = videoFrameQueue.size() * frameDuration / 100.0;
std::this_thread::sleep_for(std::chrono::milliseconds((int)(frameDuration / scale)));
}
_lastFrame = frame;
return frame;
}
Expand Down

0 comments on commit 6610e23

Please sign in to comment.