Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
05fda675
Commit
05fda675
authored
Nov 30, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix possible freeze changing monitor real time
CCBUG: 429228
parent
57a9f96f
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/mainwindow.cpp
View file @
05fda675
...
...
@@ -3619,15 +3619,16 @@ void MainWindow::slotSwitchMonitorOverlay(QAction *action)
void
MainWindow
::
slotSwitchDropFrames
(
bool
drop
)
{
m_clipMonitor
->
switchDropFrames
(
drop
);
m_projectMonitor
->
switchDropFrames
(
drop
);
KdenliveSettings
::
setMonitor_dropframes
(
drop
);
m_clipMonitor
->
restart
();
m_projectMonitor
->
restart
();
}
void
MainWindow
::
slotSetMonitorGamma
(
int
gamma
)
{
KdenliveSettings
::
setMonitor_gamma
(
gamma
);
m_clipMonitor
->
updateMonitorGamma
();
m_projectMonitor
->
updateMonitorGamma
();
m_clipMonitor
->
restart
();
m_projectMonitor
->
restart
();
}
void
MainWindow
::
slotInsertZoneToTree
()
...
...
src/monitor/glwidget.cpp
View file @
05fda675
...
...
@@ -1333,11 +1333,6 @@ std::shared_ptr<Mlt::Consumer> GLWidget::consumer()
return
m_consumer
;
}
void
GLWidget
::
updateGamma
()
{
reconfigure
();
}
void
GLWidget
::
resetConsumer
(
bool
fullReset
)
{
if
(
fullReset
&&
m_consumer
)
{
...
...
@@ -1770,20 +1765,14 @@ double GLWidget::playSpeed() const
return
0.0
;
}
void
GLWidget
::
setDropFrames
(
bool
drop
)
void
GLWidget
::
restart
(
)
{
// why this lock?
QMutexLocker
locker
(
&
m_mltMutex
);
if
(
m_consumer
)
{
int
dropFrames
=
1
;
if
(
!
drop
)
{
dropFrames
=
-
dropFrames
;
}
// Make sure to delete and rebuild consumer to match profile
m_consumer
->
purge
();
m_consumer
->
stop
();
m_consumer
->
set
(
"real_time"
,
dropFrames
);
if
(
m_consumer
->
start
()
==
-
1
)
{
qCWarning
(
KDENLIVE_LOG
)
<<
"ERROR, Cannot start monitor"
;
}
reconfigure
();
}
}
...
...
src/monitor/glwidget.h
View file @
05fda675
...
...
@@ -107,7 +107,6 @@ public:
QRect
displayRect
()
const
;
/** @brief set to true if we want to emit a QImage of the frame for analysis */
bool
sendFrameForAnalysis
;
void
updateGamma
();
/** @brief delete and rebuild consumer, for example when external display is switched */
void
resetConsumer
(
bool
fullReset
);
void
lockMonitor
();
...
...
@@ -128,8 +127,8 @@ public:
int
rulerHeight
()
const
;
/** @brief return current play producer's playing speed */
double
playSpeed
()
const
;
/** @brief
T
ur
n drop frame feature on/off
*/
void
setDropFrames
(
bool
drop
);
/** @brief
P
ur
ge and restart consumer
*/
void
restart
(
);
/** @brief Returns current audio volume */
int
volume
()
const
;
/** @brief Set audio volume on consumer */
...
...
src/monitor/monitor.cpp
View file @
05fda675
...
...
@@ -1707,9 +1707,9 @@ void Monitor::updateClipZone(const QPoint zone)
m_controller
->
setZone
(
zone
);
}
void
Monitor
::
switchDropFrames
(
bool
drop
)
void
Monitor
::
restart
(
)
{
m_glMonitor
->
setDropFrames
(
drop
);
m_glMonitor
->
restart
(
);
}
void
Monitor
::
switchMonitorInfo
(
int
code
)
...
...
@@ -1731,17 +1731,6 @@ void Monitor::switchMonitorInfo(int code)
}
}
void
Monitor
::
updateMonitorGamma
()
{
if
(
isActive
())
{
stop
();
m_glMonitor
->
updateGamma
();
start
();
}
else
{
m_glMonitor
->
updateGamma
();
}
}
void
Monitor
::
slotEditMarker
()
{
if
(
m_editMarker
)
{
...
...
src/monitor/monitor.h
View file @
05fda675
...
...
@@ -125,8 +125,7 @@ public:
void
sendFrameForAnalysis
(
bool
analyse
);
void
updateAudioForAnalysis
();
void
switchMonitorInfo
(
int
code
);
void
switchDropFrames
(
bool
drop
);
void
updateMonitorGamma
();
void
restart
();
void
mute
(
bool
,
bool
updateIconOnly
=
false
)
override
;
/** @brief Returns the action displaying record toolbar */
QAction
*
recAction
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment