From: Dan Dennedy Date: Sat, 1 Feb 2014 05:37:10 +0000 (-0800) Subject: If LC_NUMERIC unsupported do not inadvertently change locale. X-Git-Url: https://git.sesse.net/?p=mlt;a=commitdiff_plain;h=4f4296e775e4cc837454ebbbc16255c00ae9fa05 If LC_NUMERIC unsupported do not inadvertently change locale. On Windows, we should be able to use _create_locale() and _free_locale() but using them results in unresolved symbols linking on mingw 4.8. Calling setlocale with fallback value of "" results in changing locale to system-defined. With this change, on OS where LC_NUMERIC changing is not supported we call with NULL, which makes the call passive. --- diff --git a/src/framework/mlt_property.c b/src/framework/mlt_property.c index e7e02f1f..251cc335 100644 --- a/src/framework/mlt_property.c +++ b/src/framework/mlt_property.c @@ -648,7 +648,7 @@ char *mlt_property_get_string_l( mlt_property self, locale_t locale ) const char *localename = locale->__names[ LC_NUMERIC ]; #else // TODO: not yet sure what to do on other platforms - const char *localename = ""; + const char *localename = NULL; #endif // Protect damaging the global locale from a temporary locale on another thread. pthread_mutex_lock( &self->mutex ); @@ -857,7 +857,7 @@ static void time_clock_from_frames( int frames, double fps, char *s ) char *mlt_property_get_time( mlt_property self, mlt_time_format format, double fps, locale_t locale ) { char *orig_localename = NULL; - const char *localename = ""; + const char *localename = NULL; // Optimization for mlt_time_frames if ( format == mlt_time_frames )