Commit 68e89f48 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix CPU usage when idle

parent 55f3848c
......@@ -578,7 +578,6 @@ void GLWidget::mousePressEvent(QMouseEvent* event)
event->ignore();
return;
}
if (event->isAccepted()) return;
if (event->button() & Qt::LeftButton) {
m_dragStart = event->pos();
}
......
......@@ -169,6 +169,9 @@ void Render::seek(int time)
m_mltProducer->seek(time);
if (!externalConsumer) {
m_isRefreshing = true;
if (m_mltConsumer->is_stopped()) {
m_mltConsumer->start();
}
m_mltConsumer->set("refresh", 1);
}
}
......@@ -744,13 +747,14 @@ void Render::switchPlay(bool play, double speed)
}
m_mltProducer->set_speed(speed);
} else {
m_mltConsumer->set("refresh", 0);
m_mltConsumer->purge();
m_mltProducer->set_speed(0.0);
m_mltConsumer->stop();
m_mltConsumer->set("buffer", 0);
m_mltConsumer->set("prefill", 0);
m_mltConsumer->set("real_time", -1);
m_mltProducer->seek(m_mltConsumer->position() + 1);
m_mltConsumer->start();
}
}
......@@ -964,7 +968,10 @@ bool Render::checkFrameNumber(int pos)
else m_mltProducer->set_speed(speed);
} else {
m_isRefreshing = false;
if (m_isZoneMode) {
if (m_mltProducer->get_speed() == 0) {
m_mltConsumer->stop();
m_mltConsumer->purge();
} else if (m_isZoneMode) {
if (pos >= m_mltProducer->get_int("out") - 1) {
if (m_isLoopMode) {
m_mltConsumer->purge();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment