Skip to content
GitLab
Menu
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
76b0eeac
Commit
76b0eeac
authored
Feb 22, 2022
by
Jean-Baptiste Mardelle
Browse files
Fix bin clip thumbnails sometimes not created
parent
0be955d8
Pipeline
#140880
passed with stage
in 6 minutes and 19 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/bin/projectclip.cpp
View file @
76b0eeac
...
...
@@ -501,7 +501,7 @@ QPixmap ProjectClip::thumbnail(int width, int height)
return
m_thumbnail
.
pixmap
(
width
,
height
);
}
bool
ProjectClip
::
setProducer
(
std
::
shared_ptr
<
Mlt
::
Producer
>
producer
)
bool
ProjectClip
::
setProducer
(
std
::
shared_ptr
<
Mlt
::
Producer
>
producer
,
bool
generateThumb
)
{
qDebug
()
<<
"################### ProjectClip::setproducer"
;
QMutexLocker
locker
(
&
m_producerMutex
);
...
...
@@ -542,6 +542,10 @@ bool ProjectClip::setProducer(std::shared_ptr<Mlt::Producer> producer)
getFileHash
();
// set parent again (some info need to be stored in producer)
updateParent
(
parentItem
().
lock
());
if
(
generateThumb
&&
m_clipType
!=
ClipType
::
Audio
)
{
// Generate video thumb
ClipLoadTask
::
start
({
ObjectType
::
BinClip
,
m_binId
.
toInt
()},
QDomElement
(),
true
,
-
1
,
-
1
,
this
);
}
if
(
KdenliveSettings
::
audiothumbnails
()
&&
(
m_clipType
==
ClipType
::
AV
||
m_clipType
==
ClipType
::
Audio
||
m_clipType
==
ClipType
::
Playlist
||
m_clipType
==
ClipType
::
Unknown
))
{
AudioLevelsTask
::
start
({
ObjectType
::
BinClip
,
m_binId
.
toInt
()},
this
,
false
);
}
...
...
src/bin/projectclip.h
View file @
76b0eeac
...
...
@@ -289,7 +289,7 @@ public slots:
* @param replaceProducer If true, we replace existing producer with this one
* @returns true if producer was changed
* . */
bool
setProducer
(
std
::
shared_ptr
<
Mlt
::
Producer
>
producer
);
bool
setProducer
(
std
::
shared_ptr
<
Mlt
::
Producer
>
producer
,
bool
generateThumb
=
false
);
void
importJsonMarkers
(
const
QString
&
json
);
/** @brief Refresh zones of insertion in timeline. */
...
...
src/jobs/cliploadtask.cpp
View file @
76b0eeac
...
...
@@ -225,7 +225,7 @@ void ClipLoadTask::generateThumbnail(std::shared_ptr<ProjectClip>binClip, std::s
// Fetch thumbnail
qDebug
()
<<
"=====
\n
READY FOR THUMB"
<<
binClip
->
clipType
()
<<
"
\n\n
========="
;
int
frameNumber
=
m_in
>
-
1
?
m_in
:
qMax
(
0
,
binClip
->
getProducerIntProperty
(
QStringLiteral
(
"kdenlive:thumbnailFrame"
)));
if
(
binClip
->
clipType
()
!=
ClipType
::
Audio
&&
producer
->
get_int
(
"video_index"
)
>
-
1
)
{
if
(
producer
->
get_int
(
"video_index"
)
>
-
1
)
{
if
(
ThumbnailCache
::
get
()
->
hasThumbnail
(
QString
::
number
(
m_owner
.
second
),
frameNumber
,
false
))
{
// Thumbnail found in cache
QImage
result
=
ThumbnailCache
::
get
()
->
getThumbnail
(
QString
::
number
(
m_owner
.
second
),
frameNumber
);
...
...
@@ -659,13 +659,12 @@ void ClipLoadTask::run()
if
(
!
m_isCanceled
)
{
auto
binClip
=
pCore
->
projectItemModel
()
->
getClipByBinID
(
QString
::
number
(
m_owner
.
second
));
if
(
binClip
)
{
QMetaObject
::
invokeMethod
(
binClip
.
get
(),
"setProducer"
,
Qt
::
QueuedConnection
,
Q_ARG
(
std
::
shared_ptr
<
Mlt
::
Producer
>
,
producer
));
QMetaObject
::
invokeMethod
(
binClip
.
get
(),
"setProducer"
,
Qt
::
QueuedConnection
,
Q_ARG
(
std
::
shared_ptr
<
Mlt
::
Producer
>
,
producer
)
,
Q_ARG
(
bool
,
true
)
);
if
(
checkProfile
&&
!
isVariableFrameRate
&&
seekable
)
{
pCore
->
bin
()
->
shouldCheckProfile
=
false
;
QMetaObject
::
invokeMethod
(
pCore
->
bin
(),
"slotCheckProfile"
,
Qt
::
QueuedConnection
,
Q_ARG
(
QString
,
QString
::
number
(
m_owner
.
second
)));
}
}
generateThumbnail
(
binClip
,
producer
);
emit
taskDone
();
}
else
{
// Might be aborted by profile switch
...
...
src/jobs/proxytask.cpp
View file @
76b0eeac
...
...
@@ -37,7 +37,7 @@ void ProxyTask::start(const ObjectId &owner, QObject* object, bool force)
task
=
nullptr
;
}
if
(
task
)
{
// Otherwise, start a new
audio levels
generation thread.
// Otherwise, start a new
proxy
generation thread.
task
->
m_isForce
=
force
;
pCore
->
taskManager
.
startTask
(
owner
.
second
,
task
);
}
...
...
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