]> git.sesse.net Git - mlt/commitdiff
If LC_NUMERIC unsupported do not inadvertently change locale.
authorDan Dennedy <dan@dennedy.org>
Sat, 1 Feb 2014 05:37:10 +0000 (21:37 -0800)
committerDan Dennedy <dan@dennedy.org>
Sat, 1 Feb 2014 05:37:10 +0000 (21:37 -0800)
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

index e7e02f1f0013dc1c928f6d6672bffd51bb55414a..251cc33585bfd52d020d6554b1d62aed35bace4e 100644 (file)
@@ -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 )