From 4f4296e775e4cc837454ebbbc16255c00ae9fa05 Mon Sep 17 00:00:00 2001 From: Dan Dennedy Date: Fri, 31 Jan 2014 21:37:10 -0800 Subject: [PATCH] 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. --- src/framework/mlt_property.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ) -- 2.39.2