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
504a5f2b
Commit
504a5f2b
authored
Mar 02, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix cache thumbs incorrectly using full res profile
parent
f8ecc140
Pipeline
#15895
passed with stage
in 13 minutes and 38 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/bin/projectclip.cpp
View file @
504a5f2b
...
...
@@ -499,7 +499,10 @@ bool ProjectClip::setProducer(std::shared_ptr<Mlt::Producer> producer, bool repl
emit
refreshPropertiesPanel
();
if
(
m_clipType
==
ClipType
::
AV
||
m_clipType
==
ClipType
::
Video
||
m_clipType
==
ClipType
::
Playlist
)
{
QTimer
::
singleShot
(
1000
,
this
,
[
this
]()
{
pCore
->
jobManager
()
->
startJob
<
CacheJob
>
({
m_binId
},
-
1
,
QString
());
int
loadjobId
;
if
(
!
pCore
->
jobManager
()
->
hasPendingJob
(
m_binId
,
AbstractClipJob
::
CACHEJOB
,
&
loadjobId
))
{
pCore
->
jobManager
()
->
startJob
<
CacheJob
>
({
m_binId
},
-
1
,
QString
());
}
});
}
replaceInTimeline
();
...
...
@@ -1493,8 +1496,7 @@ void ProjectClip::getThumbFromPercent(int percent)
}
else
{
// Generate percent thumbs
int
id
;
if
(
pCore
->
jobManager
()
->
hasPendingJob
(
m_binId
,
AbstractClipJob
::
CACHEJOB
,
&
id
))
{
}
else
{
if
(
!
pCore
->
jobManager
()
->
hasPendingJob
(
m_binId
,
AbstractClipJob
::
CACHEJOB
,
&
id
))
{
pCore
->
jobManager
()
->
startJob
<
CacheJob
>
({
m_binId
},
-
1
,
QString
(),
50
);
}
}
...
...
src/bin/projectsubclip.cpp
View file @
504a5f2b
...
...
@@ -205,8 +205,7 @@ void ProjectSubClip::getThumbFromPercent(int percent)
}
else
{
// Generate percent thumbs
int
id
;
if
(
pCore
->
jobManager
()
->
hasPendingJob
(
m_parentClipId
,
AbstractClipJob
::
CACHEJOB
,
&
id
))
{
}
else
{
if
(
!
pCore
->
jobManager
()
->
hasPendingJob
(
m_parentClipId
,
AbstractClipJob
::
CACHEJOB
,
&
id
))
{
pCore
->
jobManager
()
->
startJob
<
CacheJob
>
({
m_parentClipId
},
-
1
,
QString
(),
25
,
m_inPoint
,
m_outPoint
);
}
}
...
...
src/core.cpp
View file @
504a5f2b
...
...
@@ -756,13 +756,13 @@ Mlt::Profile *Core::thumbProfile()
QMutexLocker
lck
(
&
m_thumbProfileMutex
);
if
(
!
m_thumbProfile
)
{
m_thumbProfile
=
std
::
make_unique
<
Mlt
::
Profile
>
(
m_currentProfile
.
toStdString
().
c_str
());
/*
double factor = 144. / m_thumbProfile->height();
double
factor
=
144.
/
m_thumbProfile
->
height
();
m_thumbProfile
->
set_height
(
144
);
int
width
=
m_thumbProfile
->
width
()
*
factor
+
0.5
;
if
(
width
%
2
>
0
)
{
width
++
;
}
m_thumbProfile->set_width(width);
*/
m_thumbProfile
->
set_width
(
width
);
}
return
m_thumbProfile
.
get
();
}
...
...
src/jobs/cachejob.cpp
View file @
504a5f2b
...
...
@@ -89,8 +89,11 @@ bool CacheJob::startJob()
m_thumbsCount
=
duration
/
10
;
}
std
::
set
<
int
>
frames
;
for
(
int
i
=
1
;
i
<=
m_thumbsCount
;
++
i
)
{
frames
.
insert
(
m_inPoint
+
(
duration
*
i
/
m_thumbsCount
));
double
steps
=
qMax
(
pCore
->
getCurrentFps
(),
(
double
)
duration
/
m_thumbsCount
);
int
pos
=
m_inPoint
;
for
(
int
i
=
1
;
i
<=
m_thumbsCount
&&
pos
<=
duration
;
++
i
)
{
frames
.
insert
(
pos
);
pos
=
m_inPoint
+
(
steps
*
i
);
}
int
size
=
(
int
)
frames
.
size
();
int
count
=
0
;
...
...
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