Skip to content

Add framerate control to sherlock265 #310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
rename variable
  • Loading branch information
EdenGottlieb committed Dec 16, 2021
commit f882c2a14e1616f5ed2dd75b716ebd33f744bd3a
5 changes: 3 additions & 2 deletions sherlock265/VideoDecoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ void VideoDecoder::decoder_loop()
img = de265_peek_next_picture(ctx);
while (img==NULL)
{
auto start = system_clock::now();
auto start_time = system_clock::now();

mutex.unlock();
int more=1;
de265_error err = de265_decode(ctx, &more);
Expand All @@ -143,7 +144,7 @@ void VideoDecoder::decoder_loop()
if (more && err == DE265_OK) {
// try again to get picture

duration<double> decode_time = system_clock::now() - start;
duration<double> decode_time = system_clock::now() - start_time;
duration<double> sleep_for_time = milliseconds(33) - decode_time;

std::this_thread::sleep_for(sleep_for_time);
Expand Down