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
259
Issues
259
List
Boards
Labels
Service Desk
Milestones
Merge Requests
14
Merge Requests
14
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
58fd31a5
Commit
58fd31a5
authored
Sep 29, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some extra checks for mixes
parent
18fae083
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
2 deletions
+54
-2
src/timeline2/model/timelinemodel.cpp
src/timeline2/model/timelinemodel.cpp
+12
-2
src/timeline2/model/trackmodel.cpp
src/timeline2/model/trackmodel.cpp
+42
-0
No files found.
src/timeline2/model/timelinemodel.cpp
View file @
58fd31a5
...
...
@@ -4130,6 +4130,9 @@ bool TimelineModel::unplantComposition(int compoId)
bool
TimelineModel
::
checkConsistency
()
{
// We store all in/outs of clips to check snap points
std
::
map
<
int
,
int
>
snaps
;
for
(
const
auto
&
tck
:
m_iteratorTable
)
{
auto
track
=
(
*
tck
.
second
);
// Check parent/children link for tracks
...
...
@@ -4149,8 +4152,6 @@ bool TimelineModel::checkConsistency()
}
}
// We store all in/outs of clips to check snap points
std
::
map
<
int
,
int
>
snaps
;
// Check parent/children link for clips
for
(
const
auto
&
cp
:
m_allClips
)
{
auto
clip
=
(
cp
.
second
);
...
...
@@ -4167,6 +4168,9 @@ bool TimelineModel::checkConsistency()
if
(
getClipTrackId
(
cp
.
first
)
!=
-
1
)
{
snaps
[
clip
->
getPosition
()]
+=
1
;
snaps
[
clip
->
getPosition
()
+
clip
->
getPlaytime
()]
+=
1
;
if
(
clip
->
getMixDuration
()
>
0
)
{
snaps
[
clip
->
getPosition
()
+
clip
->
getMixDuration
()
-
clip
->
getMixCutPosition
()]
+=
1
;
}
}
if
(
!
clip
->
checkConsistency
())
{
qDebug
()
<<
"Consistency check failed for clip"
<<
cp
.
first
;
...
...
@@ -4190,9 +4194,15 @@ bool TimelineModel::checkConsistency()
snaps
[
clip
->
getPosition
()
+
clip
->
getPlaytime
()]
+=
1
;
}
}
// Check snaps
auto
stored_snaps
=
m_snaps
->
_snaps
();
if
(
snaps
.
size
()
!=
stored_snaps
.
size
())
{
for
(
auto
sn
:
stored_snaps
)
{
qDebug
()
<<
"==== GOT SNAP: "
<<
sn
.
first
;
}
qDebug
()
<<
"Wrong number of snaps: "
<<
snaps
.
size
()
<<
" == "
<<
stored_snaps
.
size
();
return
false
;
}
...
...
src/timeline2/model/trackmodel.cpp
View file @
58fd31a5
...
...
@@ -1000,6 +1000,48 @@ bool TrackModel::checkConsistency()
}
--
it
;
}
// Check Mixes
QScopedPointer
<
Mlt
::
Service
>
service
(
m_track
->
field
());
int
mixCount
=
0
;
qDebug
()
<<
"=== STARTING MIX CHECK ======"
;
while
(
service
!=
nullptr
&&
service
->
is_valid
())
{
if
(
service
->
type
()
==
transition_type
)
{
Mlt
::
Transition
t
((
mlt_transition
)
service
->
get_service
());
service
.
reset
(
service
->
producer
());
// Check that the mix has correct in/out
int
mainId
=
-
1
;
int
mixIn
=
t
.
get_in
();
for
(
auto
it
=
m_sameCompositions
.
begin
();
it
!=
m_sameCompositions
.
end
();
++
it
)
{
if
(
it
->
second
->
get_in
()
==
mixIn
)
{
// Found mix in list
mainId
=
it
->
first
;
break
;
}
}
if
(
mainId
==
-
1
)
{
qDebug
()
<<
"=== Incoherent mix found at: "
<<
mixIn
;
return
false
;
}
// Check in/out)
if
(
mixIn
!=
m_allClips
[
mainId
]
->
getPosition
())
{
qDebug
()
<<
"=== Mix not aligned with its master clip: "
<<
mainId
<<
", at: "
<<
m_allClips
[
mainId
]
->
getPosition
()
<<
", MIX at: "
<<
mixIn
;
return
false
;
}
int
secondClipId
=
m_mixList
.
key
(
mainId
);
if
(
t
.
get_out
()
!=
m_allClips
[
secondClipId
]
->
getPosition
()
+
m_allClips
[
secondClipId
]
->
getPlaytime
())
{
qDebug
()
<<
"=== Mix not aligned with its second clip: "
<<
secondClipId
<<
", end at: "
<<
m_allClips
[
secondClipId
]
->
getPosition
()
+
m_allClips
[
secondClipId
]
->
getPlaytime
()
<<
", MIX at: "
<<
t
.
get_out
();
return
false
;
}
mixCount
++
;
}
else
{
service
.
reset
(
service
->
producer
());
}
}
if
(
mixCount
!=
m_sameCompositions
.
size
()
||
m_sameCompositions
.
size
()
!=
m_mixList
.
count
())
{
// incoherent mix count
qDebug
()
<<
"=== INCORRECT mix count. Existing: "
<<
mixCount
<<
"; REGISTERED: "
<<
m_mixList
.
count
();
return
false
;
}
return
true
;
}
...
...
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