Commit 0203cf88 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

Win32: minor thread-safety fix

parent 738b0607
......@@ -211,7 +211,9 @@ const char *GetFallbackEncoding( void )
return FindFallbackEncoding (psz_lang);
#else
static char buf[16] = "";
static vlc_mutex_t lock = VLC_STATIC_MUTEX;
vlc_mutex_lock (&lock);
if (buf[0] == 0)
{
int cp = GetACP ();
......@@ -225,6 +227,7 @@ const char *GetFallbackEncoding( void )
snprintf (buf, sizeof (buf), "CP%u", cp);
}
}
vlc_mutex_unlock (&lock);
return buf;
#endif
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment