fix application crash for Android #199

This commit is contained in:
Nikolaos Ftylitakis 2021-12-02 19:17:02 +02:00
parent 638e68de6c
commit ea3983ffe8
1 changed files with 6 additions and 0 deletions

View File

@ -61,7 +61,10 @@ void QZXingFilter::processFrame(const QVideoFrame &frame) {
#ifdef Q_OS_ANDROID
f.unmap();
#endif
#ifndef Q_OS_ANDROID
processThread = QtConcurrent::run([=](){
#endif
if(image.isNull())
{
qDebug() << "QZXingFilter error: Cant create image file to process.";
@ -83,5 +86,8 @@ void QZXingFilter::processFrame(const QVideoFrame &frame) {
// qDebug() << "saving image" << i << "at:" << path << frameToProcess.save(path);
decoder.decodeImage(frameToProcess, frameToProcess.width(), frameToProcess.height());
#ifndef Q_OS_ANDROID
});
#endif
}