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
68556dbd
Commit
68556dbd
authored
Sep 02, 2018
by
Jean-Baptiste Mardelle
Browse files
Fix proxy creation not restarting when changing a property while creating proxy
parent
5cd17e33
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/bin/bin.cpp
View file @
68556dbd
...
...
@@ -2504,9 +2504,9 @@ void Bin::refreshClipMarkers(const QString &id)
}
}
void
Bin
::
discardJobs
(
const
QString
&
id
,
AbstractClipJob
::
JOBTYPE
type
)
bool
Bin
::
discardJobs
(
const
QString
&
id
,
AbstractClipJob
::
JOBTYPE
type
)
{
m_jobManager
->
discardJobs
(
id
,
type
);
return
m_jobManager
->
discardJobs
(
id
,
type
);
}
void
Bin
::
slotStartCutJob
(
const
QString
&
id
)
...
...
src/bin/bin.h
View file @
68556dbd
...
...
@@ -214,8 +214,10 @@ public:
/** @brief Start a job of selected type for a clip */
void
startJob
(
const
QString
&
id
,
AbstractClipJob
::
JOBTYPE
type
);
/** @brief Discard jobs from a chosen type, use NOJOBTYPE to discard all jobs for this clip */
void
discardJobs
(
const
QString
&
id
,
AbstractClipJob
::
JOBTYPE
type
=
AbstractClipJob
::
NOJOBTYPE
);
/** @brief Discard jobs from a chosen type, use NOJOBTYPE to discard all jobs for this clip
* @returns true if a job was found and discarded
*/
bool
discardJobs
(
const
QString
&
id
,
AbstractClipJob
::
JOBTYPE
type
=
AbstractClipJob
::
NOJOBTYPE
);
/** @brief Check if there is a job waiting / running for this clip */
bool
hasPendingJob
(
const
QString
&
id
,
AbstractClipJob
::
JOBTYPE
type
);
...
...
src/bin/projectclip.cpp
View file @
68556dbd
...
...
@@ -282,8 +282,17 @@ void ProjectClip::reloadProducer(bool refreshOnly)
// set a special flag to request thumbnail only
xml
.
setAttribute
(
QStringLiteral
(
"refreshOnly"
),
QStringLiteral
(
"1"
));
}
else
{
bin
()
->
discardJobs
(
m_id
,
AbstractClipJob
::
PROXYJOB
);
if
(
hasProxy
())
{
if
(
bin
()
->
discardJobs
(
m_id
,
AbstractClipJob
::
PROXYJOB
))
{
// A proxy job was running, reset proxy property to trigger proxy creation
QString
path
=
getProducerProperty
(
QStringLiteral
(
"_proxy"
));
if
(
!
path
.
isEmpty
())
{
EffectsList
::
setProperty
(
xml
,
QStringLiteral
(
"kdenlive:proxy"
),
path
.
toUtf8
().
constData
());
}
// If we have a proxy, delete it
xml
.
setAttribute
(
QStringLiteral
(
"overwriteproxy"
),
QStringLiteral
(
"1"
));
setProducerProperty
(
QStringLiteral
(
"_overwriteproxy"
),
QStringLiteral
(
"1"
));
}
else
if
(
hasProxy
())
{
// If we have a proxy, delete it
xml
.
setAttribute
(
QStringLiteral
(
"overwriteproxy"
),
QStringLiteral
(
"1"
));
setProducerProperty
(
QStringLiteral
(
"_overwriteproxy"
),
QStringLiteral
(
"1"
));
...
...
src/mltcontroller/producerqueue.cpp
View file @
68556dbd
...
...
@@ -194,6 +194,8 @@ void ProducerQueue::processFileProperties()
if
(
QFileInfo
(
path
).
size
()
<=
0
||
info
.
xml
.
hasAttribute
(
QStringLiteral
(
"overwriteproxy"
)))
{
// proxy is missing, re-create it
emit
requestProxy
(
info
.
clipId
);
m_processingClipId
.
removeAll
(
info
.
clipId
);
continue
;
proxyProducer
=
false
;
//path = info.xml.attribute("resource");
path
=
ProjectClip
::
getXmlProperty
(
info
.
xml
,
QStringLiteral
(
"resource"
));
...
...
src/project/jobs/jobmanager.cpp
View file @
68556dbd
...
...
@@ -81,7 +81,7 @@ QStringList JobManager::getPendingJobs(const QString &id)
return
result
;
}
void
JobManager
::
discardJobs
(
const
QString
&
id
,
AbstractClipJob
::
JOBTYPE
type
)
bool
JobManager
::
discardJobs
(
const
QString
&
id
,
AbstractClipJob
::
JOBTYPE
type
)
{
QMutexLocker
lock
(
&
m_jobMutex
);
bool
jobFound
=
false
;
...
...
@@ -96,6 +96,7 @@ void JobManager::discardJobs(const QString &id, AbstractClipJob::JOBTYPE type)
emit
updateJobStatus
(
id
,
type
,
JobAborted
);
updateJobCount
();
}
return
jobFound
;
}
bool
JobManager
::
hasPendingJob
(
const
QString
&
clipId
,
AbstractClipJob
::
JOBTYPE
type
)
...
...
src/project/jobs/jobmanager.h
View file @
68556dbd
...
...
@@ -50,8 +50,9 @@ public:
/** @brief Discard specific job type for a clip.
* @param id the clip id
* @param type The type of job that you want to abort, leave to NOJOBTYPE to abort all jobs
* @returns true if a job was found and discarded
*/
void
discardJobs
(
const
QString
&
id
,
AbstractClipJob
::
JOBTYPE
type
=
AbstractClipJob
::
NOJOBTYPE
);
bool
discardJobs
(
const
QString
&
id
,
AbstractClipJob
::
JOBTYPE
type
=
AbstractClipJob
::
NOJOBTYPE
);
/** @brief Check if there is a pending / running job a clip.
* @param id the clip id
...
...
src/project/jobs/proxyclipjob.cpp
View file @
68556dbd
...
...
@@ -334,11 +334,13 @@ QHash<ProjectClip *, AbstractClipJob *> ProxyJob::prepareJob(Bin *bin, const QLi
local_params
.
append
(
QStringLiteral
(
" -noautorotate"
));
}
QString
path
=
item
->
getProducerProperty
(
QStringLiteral
(
"kdenlive:proxy"
));
if
(
path
.
isEmpty
())
{
if
(
path
.
isEmpty
()
||
path
.
length
()
<
3
)
path
=
item
->
getProducerProperty
(
QStringLiteral
(
"_proxy"
));
if
(
path
.
isEmpty
()
||
path
.
length
()
<
3
)
{
item
->
setJobStatus
(
AbstractClipJob
::
PROXYJOB
,
JobCrashed
,
-
1
,
i18n
(
"Failed to create proxy, empty path."
));
continue
;
}
// Reset proxy path until it is really created
item
->
setProducerProperty
(
QStringLiteral
(
"_proxy"
),
path
.
toUtf8
().
constData
());
item
->
setProducerProperty
(
QStringLiteral
(
"kdenlive:proxy"
),
QString
());
if
(
item
->
getProducerIntProperty
(
QStringLiteral
(
"_overwriteproxy"
))
==
0
&&
QFileInfo
(
path
).
size
()
>
0
)
{
// Proxy already created
...
...
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