mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 13:32:54 +02:00
Fix and rebuild
This commit is contained in:
parent
9cd2dc921a
commit
98e8361690
2 changed files with 5 additions and 7 deletions
|
@ -139,7 +139,7 @@ public:
|
|||
QThread::msleep(_runDelayMs);
|
||||
}
|
||||
auto rootItem = _surface->getRootItem();
|
||||
if (rootItem) {
|
||||
if (rootItem && !_surface->getCleaned()) {
|
||||
for (auto player : rootItem->findChildren<QMediaPlayer*>()) {
|
||||
auto mediaState = player->state();
|
||||
QMediaService *svc = player->service();
|
||||
|
@ -165,12 +165,7 @@ public:
|
|||
svc->releaseControl(out);
|
||||
// if multimedia was paused, it will start playing automatically after changing audio device
|
||||
// this will reset it back to a paused state
|
||||
if (mediaState == QMediaPlayer::State::PausedState) {
|
||||
player->pause();
|
||||
}
|
||||
else if (mediaState == QMediaPlayer::State::StoppedState) {
|
||||
player->stop();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
qDebug() << "QML Audio changed to " << _newTargetDevice;
|
||||
|
@ -504,6 +499,7 @@ QOpenGLContext* OffscreenQmlSurface::getSharedContext() {
|
|||
}
|
||||
|
||||
void OffscreenQmlSurface::cleanup() {
|
||||
_isCleaned = true;
|
||||
_canvas->makeCurrent();
|
||||
|
||||
_renderControl->invalidate();
|
||||
|
|
|
@ -75,6 +75,7 @@ public:
|
|||
void pause();
|
||||
void resume();
|
||||
bool isPaused() const;
|
||||
bool getCleaned() { return _isCleaned; }
|
||||
|
||||
void setBaseUrl(const QUrl& baseUrl);
|
||||
QQuickItem* getRootItem();
|
||||
|
@ -177,6 +178,7 @@ private:
|
|||
bool _polish { true };
|
||||
bool _paused { true };
|
||||
bool _focusText { false };
|
||||
bool _isCleaned{ false };
|
||||
uint8_t _maxFps { 60 };
|
||||
MouseTranslator _mouseTranslator { [](const QPointF& p) { return p.toPoint(); } };
|
||||
QWindow* _proxyWindow { nullptr };
|
||||
|
|
Loading…
Reference in a new issue