fix(editor): miniaudio crash in wasapi due to loading order
This commit is contained in:
parent
7bd3e70c3a
commit
ae9a4adf67
1 changed files with 10 additions and 8 deletions
|
@ -7,6 +7,7 @@
|
|||
#include <QStyleFactory>
|
||||
#include <QBasicTimer>
|
||||
#include <QSurfaceFormat>
|
||||
#include <cstdio>
|
||||
#include <qfont.h>
|
||||
#include <qsurfaceformat.h>
|
||||
#include <miniaudio.h>
|
||||
|
@ -15,6 +16,15 @@ ma_engine miniaudio;
|
|||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Logger::init();
|
||||
|
||||
// Has to happen before Qt application initializes or we get an error in WASAPI initialization
|
||||
ma_result res = ma_engine_init(NULL, &miniaudio);
|
||||
if (res != MA_SUCCESS) {
|
||||
Logger::fatalErrorf("Failed to initialize Miniaudio withe error [%d]", res);
|
||||
panic();
|
||||
}
|
||||
|
||||
QSurfaceFormat format;
|
||||
format.setSamples(4);
|
||||
format.setRenderableType(QSurfaceFormat::OpenGL);
|
||||
|
@ -24,14 +34,6 @@ int main(int argc, char *argv[])
|
|||
|
||||
QApplication a(argc, argv);
|
||||
|
||||
Logger::init();
|
||||
|
||||
ma_result res = ma_engine_init(NULL, &miniaudio);
|
||||
if (res != MA_SUCCESS) {
|
||||
Logger::fatalErrorf("Failed to initialize Miniaudio withe error [%d]", res);
|
||||
panic();
|
||||
}
|
||||
|
||||
MainWindow w;
|
||||
w.show();
|
||||
int result = a.exec();
|
||||
|
|
Loading…
Add table
Reference in a new issue