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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
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
Scott Petrovic
kdenlive
Commits
fd157219
Commit
fd157219
authored
Apr 07, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix loading project broken on invalid composition
parent
684958e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
15 deletions
+11
-15
src/doc/documentvalidator.cpp
src/doc/documentvalidator.cpp
+3
-10
src/timeline2/model/builders/meltBuilder.cpp
src/timeline2/model/builders/meltBuilder.cpp
+7
-4
src/timeline2/model/timelineitemmodel.cpp
src/timeline2/model/timelineitemmodel.cpp
+1
-1
No files found.
src/doc/documentvalidator.cpp
View file @
fd157219
...
...
@@ -79,17 +79,10 @@ bool DocumentValidator::validate(const double currentVersion)
if
(
mlt
.
hasAttribute
(
QStringLiteral
(
"LC_NUMERIC"
)))
{
// Check document numeric separator (added in Kdenlive 16.12.1
QDomElement
main_playlist
=
mlt
.
firstChildElement
(
QStringLiteral
(
"playlist"
));
Q
DomNodeList
props
=
main_playlist
.
elementsByTagName
(
QStringLiteral
(
"property"
));
Q
String
sep
=
Xml
::
getXmlProperty
(
main_playlist
,
"kdenlive:docproperties.decimalPoint"
,
QString
(
));
QChar
numericalSeparator
;
for
(
int
i
=
0
;
i
<
props
.
count
();
++
i
)
{
QDomNode
n
=
props
.
at
(
i
);
if
(
n
.
toElement
().
attribute
(
QStringLiteral
(
"name"
))
==
QLatin1String
(
"kdenlive:docproperties.decimalPoint"
))
{
QString
sep
=
n
.
firstChild
().
nodeValue
();
if
(
!
sep
.
isEmpty
())
{
numericalSeparator
=
sep
.
at
(
0
);
}
break
;
}
if
(
!
sep
.
isEmpty
())
{
numericalSeparator
=
sep
.
at
(
0
);
}
bool
error
=
false
;
if
(
!
numericalSeparator
.
isNull
()
&&
numericalSeparator
!=
QLocale
().
decimalPoint
())
{
...
...
src/timeline2/model/builders/meltBuilder.cpp
View file @
fd157219
...
...
@@ -37,6 +37,7 @@
#include <mlt++/MltPlaylist.h>
#include <mlt++/MltProducer.h>
#include <mlt++/MltTransition.h>
#include <mlt++/MltProfile.h>
static
QStringList
m_errorMessage
;
...
...
@@ -111,6 +112,7 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin
qDebug
()
<<
"ERROR: Unexpected item in the timeline"
;
}
}
ok
=
true
;
// Loading compositions
QScopedPointer
<
Mlt
::
Service
>
service
(
tractor
.
producer
());
...
...
@@ -130,7 +132,6 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin
}
service
.
reset
(
service
->
producer
());
}
// Sort compositions and insert
if
(
!
compositions
.
isEmpty
())
{
std
::
sort
(
compositions
.
begin
(),
compositions
.
end
(),
[](
Mlt
::
Transition
*
a
,
Mlt
::
Transition
*
b
)
{
return
a
->
get_b_track
()
<
b
->
get_b_track
();
});
...
...
@@ -145,12 +146,13 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin
t
->
get_in
(),
t
->
get_a_track
());
continue
;
}
ok
=
timeline
->
requestCompositionInsertion
(
id
,
timeline
->
getTrackIndexFromPosition
(
t
->
get_b_track
()
-
1
),
t
->
get_a_track
(),
t
->
get_in
(),
t
->
get_length
(),
std
::
move
(
transProps
),
compoId
,
undo
,
redo
);
if
(
!
ok
)
{
qDebug
()
<<
"ERROR : failed to insert composition in track "
<<
t
->
get_b_track
()
<<
", position"
<<
t
->
get_in
()
<<
", ID: "
<<
id
<<
", MLT ID: "
<<
t
->
get
(
"id"
);
//
timeline->requestItemDeletion(compoId, false);
//timeline->requestItemDeletion(compoId, false);
m_errorMessage
<<
i18n
(
"Invalid composition %1 found on track %2 at %3."
,
t
->
get
(
"id"
),
t
->
get_b_track
(),
t
->
get_in
());
continue
;
}
...
...
@@ -162,11 +164,12 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin
timeline
->
buildTrackCompositing
();
timeline
->
updateDuration
();
if
(
!
ok
)
{
/*
if (!ok) {
// TODO log error
// Don't abort loading because of failed composition
undo();
return false;
}
}
*/
if
(
!
m_errorMessage
.
isEmpty
())
{
KMessageBox
::
sorry
(
qApp
->
activeWindow
(),
m_errorMessage
.
join
(
"
\n
"
),
i18n
(
"Problems found in your project file"
));
}
...
...
src/timeline2/model/timelineitemmodel.cpp
View file @
fd157219
...
...
@@ -116,7 +116,7 @@ QModelIndex TimelineItemModel::makeClipIndexFromID(int clipId) const
int
trackId
=
m_allClips
.
at
(
clipId
)
->
getCurrentTrackId
();
if
(
trackId
==
-
1
)
{
// Clip is not inserted in a track
qDebug
()
<<
"/// WARNING; INVALID CLIP INDEX REQUESTED
\n
________________"
;
qDebug
()
<<
"/// WARNING; INVALID CLIP INDEX REQUESTED
: "
<<
clipId
<<
"
\n
________________"
;
return
{};
}
int
row
=
getTrackById_const
(
trackId
)
->
getRowfromClip
(
clipId
);
...
...
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