There is a race condition between the ExtractThread running p->releaseResourceInternal() (and unloading the demuxer) and the main thread calling extract() and loading the demuxer inside checkAndOpen() if run in synchronous extraction mode.
// Run in main thread
auto mpExtractor = new QtAV::VideoFrameExtractor();
mpExtractor->setAsync(false);
mpExtractor->setSource("file://whatever.mp4"); // This call will unnecessarily start the ExtractThread which will unload the demuxer in p->releaseResourceInternal()
mpExtractor->setPosition(0);
mpExtractor->extract(); // The frame extraction is only successful if the demuxer is loaded. Racing happens because the ExtractThread simultaneously unloads the demuxer while the main thread loads the demuxer in checkAndOpen()
The solution is not to start the ExtractThread at all if async equals false.
There is a race condition between the ExtractThread running p->releaseResourceInternal() (and unloading the demuxer) and the main thread calling extract() and loading the demuxer inside checkAndOpen() if run in synchronous extraction mode.
The solution is not to start the ExtractThread at all if async equals false.