]> git.sesse.net Git - mlt/commitdiff
Fix serializing xmldata in kdenlivetitle (kdenlive-1841).
authorj-b-m <jb@kdenlive.org>
Mon, 18 Oct 2010 01:19:38 +0000 (18:19 -0700)
committerDan Dennedy <dan@dennedy.org>
Mon, 18 Oct 2010 01:19:38 +0000 (18:19 -0700)
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.

src/modules/qimage/kdenlivetitle_wrapper.cpp
src/modules/qimage/producer_kdenlivetitle.c

index f6ec3818e33a772679cd1bca998c4a4bf1fe4b28..85747998d0615d09d69df334ebbda16ccea40649 100755 (executable)
@@ -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 );
                }
                 
index f7133f1d8204c7d400565f3ab316b2f18a7fd8db..caf82d90a44f72767468db3204287b26eadcfcc9 100644 (file)
@@ -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 );
        }
 }