Screen Recorder: Fix blank video files

This commit is contained in:
Jason Wen
2024-02-19 17:17:39 +00:00
parent 761f6eb37f
commit 6336a51cb5
@@ -131,7 +131,7 @@ void ScreenRecoder::start() {
}
void ScreenRecoder::encoding_thread_func() {
uint64_t start_time = nanos_since_boot() -1;
uint64_t start_time = nanos_since_boot();
while (recording && encoder) {
QImage popImage;
@@ -155,10 +155,11 @@ void ScreenRecoder::stop() {
recording = false;
update();
if (encoding_thread.joinable()) {
encoding_thread.join();
}
closeEncoder();
image_queue.clear();
if (encoding_thread.joinable())
encoding_thread.join();
}
}