History

Just using usleep won't work

Zach Fox committed 10 years ago

Commit 21d45901 parent 76121a21 file · +2 −2Browse files

Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all

Unified · Split

interface/src/Application.cpp+2−2
@@ -5463,7 +5463,7 @@ void Application::takeSnapshot(bool notify, const QString& format, float aspectR · 5462 unmodified lines
5463 uint8_t* pixelArray = new uint8_t[frameNumBytes];5463 uint8_t* pixelArray = new uint8_t[frameNumBytes];
5464 uchar *bits;5464 uchar *bits;
5465 5465
5466 GifBegin(&myGifWriter, cstr, frame.width(), frame.height(), 0);5466 GifBegin(&myGifWriter, cstr, frame.width(), frame.height(), 50);
5467 for (uint8_t itr = 0; itr < 30; itr++)5467 for (uint8_t itr = 0; itr < 30; itr++)
5468 {5468 {
5469 bits = frame.bits();5469 bits = frame.bits();
@@ -5475,7 +5475,7 @@ void Application::takeSnapshot(bool notify, const QString& format, float aspectR · 5 unmodified lines
5475 pixelArray[itr2 + 3] = (uint8_t)bits[itr2 + 3]; // Alpha5475 pixelArray[itr2 + 3] = (uint8_t)bits[itr2 + 3]; // Alpha
5476 }5476 }
5477 5477
5478 GifWriteFrame(&myGifWriter, pixelArray, frame.width(), frame.height(), 0);5478 GifWriteFrame(&myGifWriter, pixelArray, frame.width(), frame.height(), 50);
5479 usleep(USECS_PER_MSEC * 50); // 1/20 sec5479 usleep(USECS_PER_MSEC * 50); // 1/20 sec
5480 // updateHeartbeat() while making the GIF so we don't scare the deadlock watchdog5480 // updateHeartbeat() while making the GIF so we don't scare the deadlock watchdog
5481 updateHeartbeat();5481 updateHeartbeat();