X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fwestley%2Fconsumer_westley.c;h=253b7ca181c24d7e868404e1c32d93d74cfd726e;hb=ae6e351c3e5bd7eef6e43f46d33d40d1977549da;hp=87ab12dfcb0eb18534014f455df47f09e4a6b330;hpb=f00476101550ec7d8e863f6516aa83bc1b524570;p=melted diff --git a/src/modules/westley/consumer_westley.c b/src/modules/westley/consumer_westley.c index 87ab12d..253b7ca 100644 --- a/src/modules/westley/consumer_westley.c +++ b/src/modules/westley/consumer_westley.c @@ -184,17 +184,16 @@ static void serialise_properties( serialise_context context, mlt_properties prop strcmp( name, "in" ) != 0 && strcmp( name, "out" ) != 0 && strcmp( name, "id" ) != 0 && + strcmp( name, "title" ) != 0 && strcmp( name, "root" ) != 0 && strcmp( name, "width" ) != 0 && strcmp( name, "height" ) != 0 ) { char *value = mlt_properties_get_value( properties, i ); - p = xmlNewChild( node, NULL, "property", NULL ); - xmlNewProp( p, "name", mlt_properties_get_name( properties, i ) ); if ( strcmp( context->root, "" ) && !strncmp( value, context->root, strlen( context->root ) ) ) - xmlNodeSetContent( p, value + strlen( context->root ) + 1 ); - else - xmlNodeSetContent( p, value ); + value += strlen( context->root ) + 1; + p = xmlNewTextChild( node, NULL, "property", value ); + xmlNewProp( p, "name", name ); } } } @@ -213,12 +212,10 @@ static void serialise_store_properties( serialise_context context, mlt_propertie char *value = mlt_properties_get_value( properties, i ); if ( value != NULL ) { - p = xmlNewChild( node, NULL, "property", NULL ); - xmlNewProp( p, "name", mlt_properties_get_name( properties, i ) ); - if ( context->root != NULL && strcmp( context->root, "" ) && !strncmp( value, context->root, strlen( context->root ) ) ) - xmlNodeSetContent( p, value + strlen( context->root ) + 1 ); - else - xmlNodeSetContent( p, value ); + if ( strcmp( context->root, "" ) && !strncmp( value, context->root, strlen( context->root ) ) ) + value += strlen( context->root ) + 1; + p = xmlNewTextChild( node, NULL, "property", value ); + xmlNewProp( p, "name", name ); } } } @@ -244,6 +241,8 @@ static inline void serialise_service_filters( serialise_context context, mlt_ser int out = mlt_properties_get_position( properties, "out" ); p = xmlNewChild( node, NULL, "filter", NULL ); xmlNewProp( p, "id", id ); + if ( mlt_properties_get( properties, "title" ) ) + xmlNewProp( p, "title", mlt_properties_get( properties, "title" ) ); if ( in != 0 || out != 0 ) { char temp[ 20 ]; @@ -276,6 +275,8 @@ static void serialise_producer( serialise_context context, mlt_service service, // Set the id xmlNewProp( child, "id", id ); + if ( mlt_properties_get( properties, "title" ) ) + xmlNewProp( child, "title", mlt_properties_get( properties, "title" ) ); xmlNewProp( child, "in", mlt_properties_get( properties, "in" ) ); xmlNewProp( child, "out", mlt_properties_get( properties, "out" ) ); serialise_properties( context, properties, child ); @@ -381,6 +382,8 @@ static void serialise_playlist( serialise_context context, mlt_service service, // Set the id xmlNewProp( child, "id", id ); + if ( mlt_properties_get( properties, "title" ) ) + xmlNewProp( child, "title", mlt_properties_get( properties, "title" ) ); // Store application specific properties serialise_store_properties( context, properties, child, context->store ); @@ -459,6 +462,10 @@ static void serialise_tractor( serialise_context context, mlt_service service, x // Set the id xmlNewProp( child, "id", id ); + if ( mlt_properties_get( properties, "title" ) ) + xmlNewProp( child, "title", mlt_properties_get( properties, "title" ) ); + if ( mlt_properties_get( properties, "global_feed" ) ) + xmlNewProp( child, "global_feed", mlt_properties_get( properties, "global_feed" ) ); xmlNewProp( child, "in", mlt_properties_get( properties, "in" ) ); xmlNewProp( child, "out", mlt_properties_get( properties, "out" ) ); @@ -491,6 +498,8 @@ static void serialise_filter( serialise_context context, mlt_service service, xm // Set the id xmlNewProp( child, "id", id ); + if ( mlt_properties_get( properties, "title" ) ) + xmlNewProp( child, "title", mlt_properties_get( properties, "title" ) ); xmlNewProp( child, "in", mlt_properties_get( properties, "in" ) ); xmlNewProp( child, "out", mlt_properties_get( properties, "out" ) ); @@ -518,6 +527,8 @@ static void serialise_transition( serialise_context context, mlt_service service // Set the id xmlNewProp( child, "id", id ); + if ( mlt_properties_get( properties, "title" ) ) + xmlNewProp( child, "title", mlt_properties_get( properties, "title" ) ); xmlNewProp( child, "in", mlt_properties_get( properties, "in" ) ); xmlNewProp( child, "out", mlt_properties_get( properties, "out" ) ); @@ -538,7 +549,7 @@ static void serialise_service( serialise_context context, mlt_service service, x if ( strcmp( mlt_type, "producer" ) == 0 ) { char *mlt_service = mlt_properties_get( properties, "mlt_service" ); - if ( mlt_properties_get( properties, "westley" ) == NULL && !strcmp( mlt_service, "tractor" ) ) + if ( mlt_properties_get( properties, "westley" ) == NULL && ( mlt_service != NULL && !strcmp( mlt_service, "tractor" ) ) ) { context->pass = 0; serialise_tractor( context, service, node ); @@ -636,6 +647,7 @@ xmlDocPtr westley_make_doc( mlt_consumer consumer, mlt_service service ) // Assign a title property if ( mlt_properties_get( properties, "title" ) != NULL ) xmlNewProp( root, "title", mlt_properties_get( properties, "title" ) ); + mlt_properties_set_int( properties, "global_feed", 1 ); // Construct the context maps context->id_map = mlt_properties_new(); @@ -704,13 +716,13 @@ static int consumer_start( mlt_consumer this ) { xmlChar *buffer = NULL; int length = 0; - xmlDocDumpMemory( doc, &buffer, &length ); + xmlDocDumpMemoryEnc( doc, &buffer, &length, "utf-8" ); mlt_properties_set( properties, resource, buffer ); xmlFree( buffer ); } else { - xmlSaveFormatFile( resource, doc, 1 ); + xmlSaveFormatFileEnc( resource, doc, "utf-8", 1 ); } // Close the document