Details
-
Bug
-
Resolution: Won't Do
-
P2: Important
-
None
-
5.12.3, 5.12.4
-
None
-
ubuntu 18.04 (qt versions 5.12.3, 5.12.4) and in windows (qt version 5.12.3 try plugins: direct show and wmf)
Description
I run in separate thread next code:
QByteArray ba_buffer; QAudioDecoder decoder; //decoder.audioFormat() is empty after finished QAudioFormat aFormat; decoder.setSourceFilename(fileInfo.absoluteFilePath()); decoder.start(); QEventLoop loop; connect(&decoder, &QAudioDecoder::bufferReady, &loop, [&decoder, &ba_buffer, &aFormat]() { auto audio_buffer = decoder.read(); aFormat = audio_buffer.format(); ba_buffer.append(audio_buffer.constData<char>(), audio_buffer.byteCount()); }); connect(&decoder, &QAudioDecoder::finished, &loop, &QEventLoop::quit, Qt::QueuedConnection); connect(&decoder, QOverload<QAudioDecoder::Error>::of(&QAudioDecoder::error), &loop, [&loop](){loop.quit();}, Qt::QueuedConnection); QTimer timer_stop; connect(&timer_stop, &QTimer::timeout, &loop, [&loop, this, &timer_stop]() { if(stopLoadDir) { loop.quit(); timer_stop.stop(); } }, Qt::QueuedConnection); timer_stop.start(100); .... if(stopLoadDir) { return data; }
I have many such threads. Sometimes I kill them (stopLoadDir = true, stopLoadDir is std::atomic<bool>), and create new. And I have program crashes or in destructor QAudioDecoder or in costructor (more exactly in QPluginServiceProvider::requestService). I have such error in ubuntu 18.04 (qt versions 5.12.3, 5.12.4) and in windows (qt version 5.12.3 try plugins: direct show and wmf)