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
145bf510
Commit
145bf510
authored
Apr 02, 2022
by
Jean-Baptiste Mardelle
Browse files
Don't query producer length on each frame
parent
3d9a1a57
Pipeline
#158460
passed with stage
in 9 minutes and 55 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/monitor/glwidget.cpp
View file @
145bf510
...
...
@@ -69,6 +69,7 @@ GLWidget::GLWidget(int id, QObject *parent)
,
m_initSem
(
0
)
,
m_analyseSem
(
1
)
,
m_isInitialized
(
false
)
,
m_maxProducerPosition
(
0
)
,
m_threadStartEvent
(
nullptr
)
,
m_threadStopEvent
(
nullptr
)
,
m_threadCreateEvent
(
nullptr
)
...
...
@@ -702,15 +703,14 @@ bool GLWidget::checkFrameNumber(int pos, int offset, bool isPlaying)
}
return
true
;
}
else
if
(
isPlaying
)
{
int
maxPos
=
m_producer
->
get_length
()
-
1
-
offset
;
if
(
pos
>
maxPos
-
2
&&
!
(
speed
<
0.
))
{
if
(
pos
>
m_maxProducerPosition
-
2
&&
!
(
speed
<
0.
))
{
// Playing past last clip, pause
m_producer
->
set_speed
(
0
);
m_proxy
->
setSpeed
(
0
);
m_consumer
->
set
(
"refresh"
,
0
);
m_consumer
->
purge
();
m_proxy
->
setPosition
(
qMax
(
0
,
maxP
os
));
m_producer
->
seek
(
qMax
(
0
,
maxP
os
));
m_proxy
->
setPosition
(
qMax
(
0
,
m_
maxP
roducerPosition
));
m_producer
->
seek
(
qMax
(
0
,
m_
maxP
roducerPosition
));
return
false
;
}
else
if
(
pos
<=
0
&&
speed
<
0.
)
{
// rewinding reached 0, pause
...
...
@@ -1722,6 +1722,7 @@ int GLWidget::getCurrentPos() const
void
GLWidget
::
setRulerInfo
(
int
duration
,
const
std
::
shared_ptr
<
MarkerListModel
>
&
model
)
{
m_maxProducerPosition
=
duration
;
rootObject
()
->
setProperty
(
"duration"
,
duration
);
if
(
model
!=
nullptr
)
{
// we are resetting marker/snap model, reset zone
...
...
src/monitor/glwidget.h
View file @
145bf510
...
...
@@ -205,6 +205,7 @@ private:
QSemaphore
m_initSem
;
QSemaphore
m_analyseSem
;
bool
m_isInitialized
;
int
m_maxProducerPosition
;
Mlt
::
Event
*
m_threadStartEvent
;
Mlt
::
Event
*
m_threadStopEvent
;
Mlt
::
Event
*
m_threadCreateEvent
;
...
...
Write
Preview
Supports
Markdown
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