Try to improve thumbnailing on macOS

This commit is contained in:
Nicolas Werner 2022-03-22 18:12:39 +01:00
parent 30ba387076
commit 447a3d4cb9
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -879,7 +879,11 @@ MediaUpload::MediaUpload(std::unique_ptr<QIODevice> source_,
} }
nhlog::ui()->debug("Duration changed {}", duration); nhlog::ui()->debug("Duration changed {}", duration);
}); });
mediaPlayer->setMedia(QMediaContent(originalFilename_), source.get());
auto originalFile = qobject_cast<QFile *>(source.get());
mediaPlayer->setMedia(
QMediaContent(originalFile ? originalFile->fileName() : originalFilename_), source.get());
mediaPlayer->play(); mediaPlayer->play();
} }