]> git.sesse.net Git - mlt/commitdiff
Ensure serialized yaml is LC_NUMERIC=C.
authorDan Dennedy <dan@dennedy.org>
Mon, 11 Jul 2011 04:44:51 +0000 (21:44 -0700)
committerDan Dennedy <dan@dennedy.org>
Mon, 11 Jul 2011 04:44:51 +0000 (21:44 -0700)
This is needed to ensure consistency. The metadata is read as string
data and converted to numbers on demand. This is why loading defaults to
C locale - since they were authored with that in mind. However, some
plugins dynamically generate metadata and may set values with int or
double. Therefore, we need to make it all output consistently, and for
now that means C.

src/framework/mlt_properties.c

index 8bab269b81f34a03923b0ecca8da914abc6e8ac2..810de35b6b5177d1b0f636d4daf2a01568bd0825 100644 (file)
@@ -1908,9 +1908,12 @@ static void serialise_yaml( mlt_properties self, strbuf output, int indent, int
 
 char *mlt_properties_serialise_yaml( mlt_properties self )
 {
+       const char *lc_numeric = mlt_properties_get_lcnumeric( self );
        strbuf b = strbuf_new();
        strbuf_printf( b, "---\n" );
+       mlt_properties_set_lcnumeric( self, "C" );
        serialise_yaml( self, b, 0, 0 );
+       mlt_properties_set_lcnumeric( self, lc_numeric );
        strbuf_printf( b, "...\n" );
        char *ret = b->string;
        strbuf_close( b );