]> git.sesse.net Git - mlt/blobdiff - src/modules/xml/consumer_xml.c
Change LC_NUMERIC support to use GLIBC instead of linux define.
[mlt] / src / modules / xml / consumer_xml.c
index 92988f142f61f28fc17f747d0b240c989e0b3f45..b7936a9d92f509db59986ab1efa85075255f4146 100644 (file)
@@ -698,7 +698,6 @@ static void serialise_service( serialise_context context, mlt_service service, x
 static void serialise_other( mlt_properties properties, struct serialise_context_s *context, xmlNodePtr root )
 {
        int i;
-       mlt_properties_debug( properties, __FUNCTION__, stderr );
        for ( i = 0; i < mlt_properties_count( properties ); i++ )
        {
                const char* name = mlt_properties_get_name( properties, i );
@@ -843,6 +842,12 @@ static void output_xml( mlt_consumer this )
                free( cwd );
        }
 
+#if !defined(__GLIBC__) && !defined(__DARWIN__)
+       // Get the current locale
+       char *orig_localename = strdup( setlocale( LC_NUMERIC, NULL ) );
+       setlocale( LC_NUMERIC, "C" );
+#endif
+
        // Make the document
        doc = xml_make_doc( this, service );
 
@@ -868,6 +873,12 @@ static void output_xml( mlt_consumer this )
                xmlSaveFormatFileEnc( resource, doc, "utf-8", 1 );
        }
 
+#if !defined(__GLIBC__) && !defined(__DARWIN__)
+       // Restore the current locale
+       setlocale( LC_NUMERIC, orig_localename );
+       free( orig_localename );
+#endif
+
        // Close the document
        xmlFreeDoc( doc );
 }