Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
258
Issues
258
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
c049c15c
Commit
c049c15c
authored
Jul 29, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix project clips have incorrect length after changing project fps
Related to
#286
parent
6fb5c447
Pipeline
#6006
passed with stage
in 21 minutes and 1 second
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
13 deletions
+27
-13
src/jobs/meltjob.cpp
src/jobs/meltjob.cpp
+8
-9
src/project/projectmanager.cpp
src/project/projectmanager.cpp
+9
-0
src/timeline2/view/timelinecontroller.cpp
src/timeline2/view/timelinecontroller.cpp
+7
-2
src/timeline2/view/timelinecontroller.h
src/timeline2/view/timelinecontroller.h
+3
-2
No files found.
src/jobs/meltjob.cpp
View file @
c049c15c
...
...
@@ -107,20 +107,19 @@ bool MeltJob::startJob()
int
fps_den
=
projectProfile
->
frame_rate_den
();
m_producer
=
std
::
make_unique
<
Mlt
::
Producer
>
(
*
m_profile
.
get
(),
m_url
.
toUtf8
().
constData
());
if
(
m_producer
&&
m_useProducerProfile
)
{
m_profile
->
from_producer
(
*
m_producer
.
get
());
m_profile
->
set_explicit
(
1
);
}
if
(
m_useProducerProfile
)
{
configureProfile
();
if
(
!
qFuzzyCompare
(
m_profile
->
fps
(),
fps
))
{
// Reload producer
// Force same fps as projec profile or the resulting .mlt will not load in our project
qDebug
()
<<
"/// FORCING FRAME RATE TO: "
<<
fps_num
<<
"
\n
-------------------"
;
m_profile
->
set_frame_rate
(
fps_num
,
fps_den
);
m_producer
=
std
::
make_unique
<
Mlt
::
Producer
>
(
*
m_profile
.
get
(),
m_url
.
toUtf8
().
constData
());
}
}
if
(
!
qFuzzyCompare
(
m_profile
->
fps
(),
fps
)
&&
m_useProducerProfile
)
{
// Reload producer
// Force same fps as projec profile or the resulting .mlt will not load in our project
m_profile
->
set_frame_rate
(
fps_num
,
fps_den
);
m_producer
=
std
::
make_unique
<
Mlt
::
Producer
>
(
*
m_profile
.
get
(),
m_url
.
toUtf8
().
constData
());
}
if
((
m_producer
==
nullptr
)
||
!
m_producer
->
is_valid
())
{
// Clip was removed or something went wrong, Notify user?
m_errorMessage
.
append
(
i18n
(
"Invalid clip"
));
...
...
src/project/projectmanager.cpp
View file @
c049c15c
...
...
@@ -1015,6 +1015,15 @@ void ProjectManager::saveWithUpdatedProfile(const QString &updatedProfile)
break
;
}
}
QDomNodeList
producers
=
doc
.
documentElement
().
elementsByTagName
(
QStringLiteral
(
"producer"
));
for
(
int
i
=
0
;
i
<
producers
.
count
();
++
i
)
{
QDomElement
e
=
producers
.
at
(
i
).
toElement
();
int
length
=
Xml
::
getXmlProperty
(
e
,
QStringLiteral
(
"length"
)).
toInt
();
if
(
length
>
0
)
{
// calculate updated length
Xml
::
setXmlProperty
(
e
,
QStringLiteral
(
"length"
),
pCore
->
window
()
->
getMainTimeline
()
->
controller
()
->
framesToClock
(
length
));
}
}
QFile
file
(
convertedFile
);
if
(
!
file
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Text
))
{
return
;
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
c049c15c
...
...
@@ -483,12 +483,17 @@ void TimelineController::triggerAction(const QString &name)
pCore
->
triggerAction
(
name
);
}
QString
TimelineController
::
timecode
(
int
frames
)
QString
TimelineController
::
timecode
(
int
frames
)
const
{
return
KdenliveSettings
::
frametimecode
()
?
QString
::
number
(
frames
)
:
m_model
->
tractor
()
->
frames_to_time
(
frames
,
mlt_time_smpte_df
);
}
QString
TimelineController
::
simplifiedTC
(
int
frames
)
QString
TimelineController
::
framesToClock
(
int
frames
)
const
{
return
m_model
->
tractor
()
->
frames_to_time
(
frames
,
mlt_time_clock
);
}
QString
TimelineController
::
simplifiedTC
(
int
frames
)
const
{
if
(
KdenliveSettings
::
frametimecode
())
{
return
QString
::
number
(
frames
);
...
...
src/timeline2/view/timelinecontroller.h
View file @
c049c15c
...
...
@@ -167,8 +167,9 @@ public:
Q_INVOKABLE
bool
snap
();
Q_INVOKABLE
bool
ripple
();
Q_INVOKABLE
bool
scrub
();
Q_INVOKABLE
QString
timecode
(
int
frames
);
Q_INVOKABLE
QString
simplifiedTC
(
int
frames
);
Q_INVOKABLE
QString
timecode
(
int
frames
)
const
;
QString
framesToClock
(
int
frames
)
const
;
Q_INVOKABLE
QString
simplifiedTC
(
int
frames
)
const
;
/* @brief Request inserting a new clip in timeline (dragged from bin or monitor)
@param tid is the destination track
@param position is the timeline position
...
...
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