Fix codecs update threading

This commit is contained in:
Christophe Deschamps 2025-01-10 16:04:51 +01:00
parent d5f8c1af0a
commit aef8d4b6c5
2 changed files with 2 additions and 1 deletions

View file

@ -85,6 +85,7 @@ void DownloadablePayloadTypeCore::setSelf(QSharedPointer<DownloadablePayloadType
}
void DownloadablePayloadTypeCore::downloadAndExtract(bool isUpdate) {
mustBeInMainThread(log().arg(Q_FUNC_INFO));
lInfo() << log().arg("Downloading `%1` codec...").arg(mMimeType);
auto codecsFolder = Paths::getCodecsDirPath();
QString versionFilePath = codecsFolder + mMimeType + ".txt";

View file

@ -1396,7 +1396,7 @@ QList<QSharedPointer<DownloadablePayloadTypeCore>> Utils::getDownloadableVideoPa
void Utils::checkDownloadedCodecsUpdates() {
for (auto codec : getDownloadableVideoPayloadTypes()) {
if (codec->shouldDownloadUpdate()) codec->downloadAndExtract(true);
if (codec->shouldDownloadUpdate()) App::postCoreAsync([codec]() { codec->downloadAndExtract(true); });
}
}