X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fframework%2Fmlt_properties.c;h=887562c3467fee9dff0de058e5e04d885497f054;hb=47641c50da3ca4c13938d0513d604b829e8faeb2;hp=2a37ab4d9f84613752bb5288874114d781dc5aa6;hpb=1aa26da9547caaa99cf76ad28e1c609a75a3f554;p=mlt diff --git a/src/framework/mlt_properties.c b/src/framework/mlt_properties.c index 2a37ab4d..887562c3 100644 --- a/src/framework/mlt_properties.c +++ b/src/framework/mlt_properties.c @@ -144,12 +144,15 @@ int mlt_properties_set_lcnumeric( mlt_properties self, const char *locale ) { property_list *list = self->local; -#if defined(__linux__) || defined(__DARWIN__) +#if defined(__GLIBC__) || defined(__DARWIN__) if ( list->locale ) freelocale( list->locale ); list->locale = newlocale( LC_NUMERIC_MASK, locale, NULL ); +#else + if ( list->locale ) + free( list->locale ); + list->locale = strdup( locale ); #endif - error = list->locale == NULL; } else error = 1; @@ -173,13 +176,13 @@ const char* mlt_properties_get_lcnumeric( mlt_properties self ) if ( list->locale ) { #if defined(__DARWIN__) - result = querylocale( LC_NUMERIC, list->locale ); -#elif defined(__linux__) - result = list->locale->__names[ LC_NUMERIC ]; + result = querylocale( LC_NUMERIC, list->locale ); +#elif defined(__GLIBC__) + result = list->locale->__names[ LC_NUMERIC ]; #else - // TODO: not yet sure what to do on other platforms + result = list->locale; #endif - } + } return result; } @@ -507,13 +510,12 @@ static inline mlt_property mlt_properties_find( mlt_properties self, const char { // Check if we're hashed if ( list->count > 0 && - name[ 0 ] == list->name[ i ][ 0 ] && !strcmp( list->name[ i ], name ) ) value = list->value[ i ]; // Locate the item for ( i = list->count - 1; value == NULL && i >= 0; i -- ) - if ( name[ 0 ] == list->name[ i ][ 0 ] && !strcmp( list->name[ i ], name ) ) + if ( !strcmp( list->name[ i ], name ) ) value = list->value[ i ]; } mlt_properties_unlock( self ); @@ -1395,10 +1397,13 @@ void mlt_properties_close( mlt_properties self ) free( list->name[ index ] ); } -#if defined(__linux__) || defined(__DARWIN__) +#if defined(__GLIBC__) || defined(__DARWIN__) // Cleanup locale if ( list->locale ) freelocale( list->locale ); +#else + if ( list->locale ) + free( list->locale ); #endif // Clear up the list