Hi.
While looking at Kdenlive bugreport #2304, I discovered the following line in
the kdenlivetitle producer module:
setlocale(LC_NUMERIC,"POSIX");
Of course, that caused major problems in MLT when used in non english locales.
I think it might be the reason for the strange reports on the forum about
using an image in a title clip that made a track disappear...
Anyways, attached is a patch that fixes this behaviour as well as kdenlive
issue 2304.
regards
jb
_________________________________________________________________________
diff --git a/src/modules/qimage/kdenlivetitle_wrapper.cpp
b/src/modules/qimage/kdenlivetitle_wrapper.cpp
index 8574799..aff08ea 100755
--- a/src/modules/qimage/kdenlivetitle_wrapper.cpp
+++ b/src/modules/qimage/kdenlivetitle_wrapper.cpp
@@ -142,7 +142,7 @@ void loadFromXml( mlt_producer producer, QGraphicsScene
*scene, const char *temp
QString replacementText = QString::fromUtf8(templateText);
doc.setContent(data);
QDomElement title = doc.documentElement();
-
+
// Check for invalid title
if ( title.isNull() || title.tagName() != "kdenlivetitle" ) return;
@@ -358,6 +358,9 @@ void drawKdenliveTitle( producer_ktitle self, mlt_frame
frame, int width, int he
mlt_producer producer = &self->parent;
mlt_profile profile = mlt_service_profile ( MLT_PRODUCER_SERVICE(
producer ) ) ;
mlt_properties producer_props = MLT_PRODUCER_PROPERTIES( producer );
+
+ // Get locale
+ const char *localename = setlocale( LC_NUMERIC, NULL );
// Obtain properties of frame
mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
@@ -407,8 +410,7 @@ void drawKdenliveTitle( producer_ktitle self, mlt_frame
frame, int width, int he
}
#endif
app = new QApplication( argc, argv );
- //fix to let the decimal point for
every locale be: "."
- setlocale(LC_NUMERIC,"POSIX");
+ QLocale::setDefault( QLocale(
localename ) );
}
}
scene = new QGraphicsScene();diff --git a/src/modules/qimage/kdenlivetitle_wrapper.cpp b/src/modules/qimage/kdenlivetitle_wrapper.cpp
index 8574799..aff08ea 100755
--- a/src/modules/qimage/kdenlivetitle_wrapper.cpp
+++ b/src/modules/qimage/kdenlivetitle_wrapper.cpp
@@ -142,7 +142,7 @@ void loadFromXml( mlt_producer producer, QGraphicsScene *scene, const char *temp
QString replacementText = QString::fromUtf8(templateText);
doc.setContent(data);
QDomElement title = doc.documentElement();
-
+
// Check for invalid title
if ( title.isNull() || title.tagName() != "kdenlivetitle" ) return;
@@ -358,6 +358,9 @@ void drawKdenliveTitle( producer_ktitle self, mlt_frame frame, int width, int he
mlt_producer producer = &self->parent;
mlt_profile profile = mlt_service_profile ( MLT_PRODUCER_SERVICE( producer ) ) ;
mlt_properties producer_props = MLT_PRODUCER_PROPERTIES( producer );
+
+ // Get locale
+ const char *localename = setlocale( LC_NUMERIC, NULL );
// Obtain properties of frame
mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
@@ -407,8 +410,7 @@ void drawKdenliveTitle( producer_ktitle self, mlt_frame frame, int width, int he
}
#endif
app = new QApplication( argc, argv );
- //fix to let the decimal point for every locale be: "."
- setlocale(LC_NUMERIC,"POSIX");
+ QLocale::setDefault( QLocale( localename ) );
}
}
scene = new QGraphicsScene();
------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops? How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Mlt-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mlt-devel