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
e23e3503
Commit
e23e3503
authored
Oct 05, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix freeze on memory usage loading invalid clips
parent
1156c6d7
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/jobs/audiothumbjob.cpp
View file @
e23e3503
...
...
@@ -351,7 +351,12 @@ bool AudioThumbJob::startJob()
}
m_lengthInFrames
=
m_prod
->
get_length
();
// Multiply this if we want more than 1 sample per frame
int
thumbResolution
=
3000
;
if
(
m_lengthInFrames
==
INT_MAX
)
{
// This is a broken file or live feed, don't attempt to generate audio thumbnails
m_done
=
true
;
m_successful
=
false
;
return
false
;
}
// Increase audio thumb resolution for longer clips to get a better resolution
if
(
m_lengthInFrames
>
10000
)
{
// More than 10 minutes at 25fps
...
...
@@ -363,7 +368,6 @@ bool AudioThumbJob::startJob()
}
}
m_thumbSize
=
QSize
(
thumbResolution
,
1000
/
pCore
->
getCurrentDar
());
m_frequency
=
m_binClip
->
audioInfo
()
->
samplingRate
();
m_frequency
=
m_frequency
<=
0
?
48000
:
m_frequency
;
...
...
src/jobs/loadjob.cpp
View file @
e23e3503
...
...
@@ -411,6 +411,19 @@ bool LoadJob::startJob()
m_errorMessage
.
append
(
i18n
(
"ERROR: Could not load clip %1: producer is invalid"
,
m_resource
));
return
false
;
}
if
(
m_producer
->
get_length
()
==
INT_MAX
&&
m_producer
->
get
(
"eof"
)
==
QLatin1String
(
"loop"
))
{
// This is a live source or broken clip
m_done
=
true
;
m_successful
=
false
;
if
(
m_producer
)
{
m_producer
.
reset
();
}
qDebug
()
<<
"=== MAX DURATION: "
<<
INT_MAX
<<
", DURATION: "
<<
(
INT_MAX
/
25
/
60
);
QMetaObject
::
invokeMethod
(
pCore
.
get
(),
"displayBinMessage"
,
Qt
::
QueuedConnection
,
Q_ARG
(
QString
,
i18n
(
"Cannot get duration for file %1"
,
m_resource
)),
Q_ARG
(
int
,
(
int
)
KMessageWidget
::
Warning
));
m_errorMessage
.
append
(
i18n
(
"ERROR: Could not load clip %1: producer is invalid"
,
m_resource
));
return
false
;
}
processProducerProperties
(
m_producer
,
m_xml
);
QString
clipName
=
Xml
::
getXmlProperty
(
m_xml
,
QStringLiteral
(
"kdenlive:clipname"
));
if
(
clipName
.
isEmpty
())
{
...
...
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