aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <[email protected]>2016-07-28 22:11:07 +0200
committerJean-Baptiste Mardelle <[email protected]>2016-07-28 22:11:07 +0200
commit7aae8e444ec673f96830fea5ba46ac46516903b5 (patch)
tree5186138ed2e2be2a6be57dab24aa2b5b5c2c4248
parent0bdcee3f687ee1ac655bce896c0a6833fa88ea13 (diff)
Fix crash on avfiltre parameters with string type
-rw-r--r--src/effectslist/initeffects.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/effectslist/initeffects.cpp b/src/effectslist/initeffects.cpp
index b6bb51c..fc9e2d3 100644
--- a/src/effectslist/initeffects.cpp
+++ b/src/effectslist/initeffects.cpp
@@ -616,16 +616,25 @@ QDomDocument initEffects::createDescriptionFromMlt(Mlt::Repository* repository,
params.setAttribute(QStringLiteral("type"), QStringLiteral("bool"));
else if (paramType == QLatin1String("geometry")) {
params.setAttribute(QStringLiteral("type"), QStringLiteral("geometry"));
- }
- else {
+ } else if (paramType == QLatin1String("string")) {
+ // string parameter are not really supported, so if we have a default value, enforce it
+ params.setAttribute(QStringLiteral("type"), QStringLiteral("fixed"));
+ if (paramdesc.get("default")) {
+ QString stringDefault = paramdesc.get("default");
+ stringDefault.remove(QLatin1Char('\''));
+ params.setAttribute(QStringLiteral("value"), stringDefault);
+ }
+ } else {
params.setAttribute(QStringLiteral("type"), paramType);
if (!QString(paramdesc.get("format")).isEmpty()) params.setAttribute(QStringLiteral("format"), paramdesc.get("format"));
}
- if (paramdesc.get("default")) params.setAttribute(QStringLiteral("default"), paramdesc.get("default"));
- if (paramdesc.get("value")) {
- params.setAttribute(QStringLiteral("value"), paramdesc.get("value"));
- } else {
- params.setAttribute(QStringLiteral("value"), paramdesc.get("default"));
+ if (!params.hasAttribute(QStringLiteral("value"))) {
+ if (paramdesc.get("default")) params.setAttribute(QStringLiteral("default"), paramdesc.get("default"));
+ if (paramdesc.get("value")) {
+ params.setAttribute(QStringLiteral("value"), paramdesc.get("value"));
+ } else {
+ params.setAttribute(QStringLiteral("value"), paramdesc.get("default"));
+ }
}
QString paramName = paramdesc.get("title");