优化线程退出时资源的释放问题

This commit is contained in:
2024-09-12 15:18:09 +08:00
parent 843b2058c3
commit 9d506e1cfc
314 changed files with 2448 additions and 529454 deletions

View File

@@ -137,7 +137,6 @@ void FFmpegDecoder::run()
qDebug() << "Decoder thread aborting";
break;
}
/*QLabel* currentVideoLabel = videoLabel;*/
QSize labelSize = currentVideoLabel->size();
mutex.unlock();
@@ -198,7 +197,7 @@ void FFmpegDecoder::run()
QImage scaledImage = img.scaled(labelSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
//currentVideoLabel->setPixmap(QPixmap::fromImage(scaledImage));
QMetaObject::invokeMethod(currentVideoLabel, "setPixmap", Qt::QueuedConnection, Q_ARG(QPixmap, QPixmap::fromImage(scaledImage)));
QThread::msleep(10); // Simulate 25 FPS frame rate
QThread::msleep(10);
}
}
av_packet_unref(packet);