Skip to content
GitLab
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
6ebbaf07
Commit
6ebbaf07
authored
Mar 31, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix 1 frame offset when dropping color/image clips in timeline
parent
f886cfde
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bin/projectclip.cpp
View file @
6ebbaf07
...
...
@@ -574,7 +574,7 @@ std::shared_ptr<Mlt::Producer> ProjectClip::getTimelineProducer(int trackId, int
(
state
==
PlaylistState
::
VideoOnly
&&
(
m_clipType
==
ClipType
::
Color
||
m_clipType
==
ClipType
::
Image
||
m_clipType
==
ClipType
::
Text
||
m_clipType
==
ClipType
::
Qml
)))
{
// Temporary copy, return clone of master
int
duration
=
m_masterProducer
->
time_to_frames
(
m_masterProducer
->
get
(
"kdenlive:duration"
));
return
std
::
shared_ptr
<
Mlt
::
Producer
>
(
m_masterProducer
->
cut
(
-
1
,
duration
>
0
?
duration
:
-
1
));
return
std
::
shared_ptr
<
Mlt
::
Producer
>
(
m_masterProducer
->
cut
(
-
1
,
duration
>
0
?
duration
-
1
:
-
1
));
}
if
(
m_timewarpProducers
.
count
(
clipId
)
>
0
)
{
m_effectStack
->
removeService
(
m_timewarpProducers
[
clipId
]);
...
...
@@ -604,7 +604,7 @@ std::shared_ptr<Mlt::Producer> ProjectClip::getTimelineProducer(int trackId, int
m_effectStack
->
addService
(
m_videoProducers
[
trackId
]);
}
int
duration
=
m_masterProducer
->
time_to_frames
(
m_masterProducer
->
get
(
"kdenlive:duration"
));
return
std
::
shared_ptr
<
Mlt
::
Producer
>
(
m_videoProducers
[
trackId
]
->
cut
(
-
1
,
duration
>
0
?
duration
:
-
1
));
return
std
::
shared_ptr
<
Mlt
::
Producer
>
(
m_videoProducers
[
trackId
]
->
cut
(
-
1
,
duration
>
0
?
duration
-
1
:
-
1
));
}
if
(
m_videoProducers
.
count
(
trackId
)
>
0
)
{
m_effectStack
->
removeService
(
m_videoProducers
[
trackId
]);
...
...
@@ -613,7 +613,7 @@ std::shared_ptr<Mlt::Producer> ProjectClip::getTimelineProducer(int trackId, int
Q_ASSERT
(
state
==
PlaylistState
::
Disabled
);
createDisabledMasterProducer
();
int
duration
=
m_masterProducer
->
time_to_frames
(
m_masterProducer
->
get
(
"kdenlive:duration"
));
return
std
::
shared_ptr
<
Mlt
::
Producer
>
(
m_disabledProducer
->
cut
(
-
1
,
duration
>
0
?
duration
:
-
1
));
return
std
::
shared_ptr
<
Mlt
::
Producer
>
(
m_disabledProducer
->
cut
(
-
1
,
duration
>
0
?
duration
-
1
:
-
1
));
}
// For timewarp clips, we keep one separate producer for each clip.
...
...
@@ -733,42 +733,6 @@ std::pair<std::shared_ptr<Mlt::Producer>, bool> ProjectClip::giveMasterAndGetTim
// we have a problem
return
{
std
::
shared_ptr
<
Mlt
::
Producer
>
(
ClipController
::
mediaUnavailable
->
cut
()),
false
};
}
/*
std::shared_ptr<Mlt::Producer> ProjectClip::timelineProducer(PlaylistState::ClipState state, int track)
{
if (!m_service.startsWith(QLatin1String("avformat"))) {
std::shared_ptr<Mlt::Producer> prod(originalProducer()->cut());
int length = getProducerIntProperty(QStringLiteral("kdenlive:duration"));
if (length > 0) {
prod->set_in_and_out(0, length);
}
return prod;
}
if (state == PlaylistState::VideoOnly) {
if (m_timelineProducers.count(0) > 0) {
return std::shared_ptr<Mlt::Producer>(m_timelineProducers.find(0)->second->cut());
}
std::shared_ptr<Mlt::Producer> videoProd = cloneProducer();
videoProd->set("audio_index", -1);
m_timelineProducers[0] = videoProd;
return std::shared_ptr<Mlt::Producer>(videoProd->cut());
}
if (state == PlaylistState::AudioOnly) {
if (m_timelineProducers.count(-track) > 0) {
return std::shared_ptr<Mlt::Producer>(m_timelineProducers.find(-track)->second->cut());
}
std::shared_ptr<Mlt::Producer> audioProd = cloneProducer();
audioProd->set("video_index", -1);
m_timelineProducers[-track] = audioProd;
return std::shared_ptr<Mlt::Producer>(audioProd->cut());
}
if (m_timelineProducers.count(track) > 0) {
return std::shared_ptr<Mlt::Producer>(m_timelineProducers.find(track)->second->cut());
}
std::shared_ptr<Mlt::Producer> normalProd = cloneProducer();
m_timelineProducers[track] = normalProd;
return std::shared_ptr<Mlt::Producer>(normalProd->cut());
}*/
std
::
shared_ptr
<
Mlt
::
Producer
>
ProjectClip
::
cloneProducer
(
bool
removeEffects
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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