Hi.

Patch below fixes an issue with the kdenlivetitle producer. Basically, the 
problem was that when loading a kdenlivetitle from a file, all the properties 
were serialized and passed to the xml consumer.

The problem became more obvious with the "embeded" images in titles, which 
then caused images to be embedded inside the kdenlive project file, causing 
problems like reported in this issue:

http://kdenlive.org/mantis/view.php?id=1841

With the patch, titles loaded from a file will not copy the xmldata.

regards
jb

____________________________________________________________________________________


diff --git a/src/modules/qimage/kdenlivetitle_wrapper.cpp 
b/src/modules/qimage/kdenlivetitle_wrapper.cpp
index f6ec381..8574799 100755
--- a/src/modules/qimage/kdenlivetitle_wrapper.cpp
+++ b/src/modules/qimage/kdenlivetitle_wrapper.cpp
@@ -414,7 +414,18 @@ void drawKdenliveTitle( producer_ktitle self, mlt_frame 
frame, int width, int he
                        scene = new QGraphicsScene();
                        scene->setItemIndexMethod( QGraphicsScene::NoIndex );
                         scene->setSceneRect(0, 0, mlt_properties_get_int( 
properties, "width" ), mlt_properties_get_int( properties, "height" ));
-                       loadFromXml( producer, scene, mlt_properties_get( 
producer_props, "xmldata" ), mlt_properties_get( producer_props, 
"templatetext" ) );
+                       if ( mlt_properties_get( producer_props, "resource" ) 
&& mlt_properties_get( producer_props, "resource" )[0] != '\0' )
+                       {
+                               // The title has a resource property, so we 
read all properties from the resource.
+                               // Do not serialize the xmldata
+                               loadFromXml( producer, scene, 
mlt_properties_get( producer_props, "_xmldata" ), mlt_properties_get( 
producer_props, "templatetext" ) );
+                       }
+                       else
+                       {
+                               // The title has no resource, all data should 
be serialized
+                               loadFromXml( producer, scene, 
mlt_properties_get( producer_props, "xmldata" ), mlt_properties_get( 
producer_props, "templatetext" ) );
+                         
+                       }
                        mlt_properties_set_data( producer_props, "qscene", 
scene, 0, ( mlt_destructor )qscene_delete, NULL );
                }
                 
diff --git a/src/modules/qimage/producer_kdenlivetitle.c 
b/src/modules/qimage/producer_kdenlivetitle.c
index f7133f1..caf82d9 100644
--- a/src/modules/qimage/producer_kdenlivetitle.c
+++ b/src/modules/qimage/producer_kdenlivetitle.c
@@ -41,7 +41,7 @@ void read_xml(mlt_properties properties)
                size=fread(infile,1,lSize,f);
                infile[size] = '\0';
                fclose(f);
-               mlt_properties_set(properties, "xmldata", infile);
+               mlt_properties_set(properties, "_xmldata", infile);
                mlt_pool_release( infile );
        }
 }
diff --git a/src/modules/qimage/kdenlivetitle_wrapper.cpp b/src/modules/qimage/kdenlivetitle_wrapper.cpp
index f6ec381..8574799 100755
--- a/src/modules/qimage/kdenlivetitle_wrapper.cpp
+++ b/src/modules/qimage/kdenlivetitle_wrapper.cpp
@@ -414,7 +414,18 @@ void drawKdenliveTitle( producer_ktitle self, mlt_frame frame, int width, int he
 			scene = new QGraphicsScene();
 			scene->setItemIndexMethod( QGraphicsScene::NoIndex );
                         scene->setSceneRect(0, 0, mlt_properties_get_int( properties, "width" ), mlt_properties_get_int( properties, "height" ));
-			loadFromXml( producer, scene, mlt_properties_get( producer_props, "xmldata" ), mlt_properties_get( producer_props, "templatetext" ) );
+			if ( mlt_properties_get( producer_props, "resource" ) && mlt_properties_get( producer_props, "resource" )[0] != '\0' )
+			{
+				// The title has a resource property, so we read all properties from the resource.
+				// Do not serialize the xmldata
+				loadFromXml( producer, scene, mlt_properties_get( producer_props, "_xmldata" ), mlt_properties_get( producer_props, "templatetext" ) );
+			}
+			else
+			{
+				// The title has no resource, all data should be serialized
+				loadFromXml( producer, scene, mlt_properties_get( producer_props, "xmldata" ), mlt_properties_get( producer_props, "templatetext" ) );
+			  
+			}
 			mlt_properties_set_data( producer_props, "qscene", scene, 0, ( mlt_destructor )qscene_delete, NULL );
 		}
                 
diff --git a/src/modules/qimage/producer_kdenlivetitle.c b/src/modules/qimage/producer_kdenlivetitle.c
index f7133f1..caf82d9 100644
--- a/src/modules/qimage/producer_kdenlivetitle.c
+++ b/src/modules/qimage/producer_kdenlivetitle.c
@@ -41,7 +41,7 @@ void read_xml(mlt_properties properties)
 		size=fread(infile,1,lSize,f);
 		infile[size] = '\0';
 		fclose(f);
-		mlt_properties_set(properties, "xmldata", infile);
+		mlt_properties_set(properties, "_xmldata", infile);
 		mlt_pool_release( infile );
 	}
 }
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Mlt-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to