优化线程退出时资源的释放问题
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user