summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <jb@kdenlive.org>2016-10-16 20:13:24 (GMT)
committerJean-Baptiste Mardelle <jb@kdenlive.org>2016-10-16 20:13:24 (GMT)
commit68e89f48be0ec2fe1767a6ea050fa87fb9b441c5 (patch)
treeebd3fc12e8ea7304047f5cb11cc2ce86ceb3a227
parent55f3848ceba2d80a43694bb2ca7522e315d2fb01 (diff)
Fix CPU usage when idle
-rw-r--r--src/monitor/glwidget.cpp1
-rw-r--r--src/renderer.cpp11
2 files changed, 9 insertions, 3 deletions
diff --git a/src/monitor/glwidget.cpp b/src/monitor/glwidget.cpp
index 4f1282a..b0fd752 100644
--- a/src/monitor/glwidget.cpp
+++ b/src/monitor/glwidget.cpp
@@ -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();
}
diff --git a/src/renderer.cpp b/src/renderer.cpp
index 87d7451..fae654f 100644
--- a/src/renderer.cpp
+++ b/src/renderer.cpp
@@ -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();