Locale changes

Systems that have locale support must be set to "C" locale otherwise
libmpv will complain.

Signed-off-by: Mahyar Koshkouei <mahyar.koshkouei@gmail.com>
This commit is contained in:
Mahyar Koshkouei 2018-01-14 11:13:02 +00:00
parent 1450694edb
commit b72446d4d6
2 changed files with 12 additions and 0 deletions

View File

@ -104,6 +104,10 @@ else
CFLAGS += -std=gnu99
endif
ifneq (,$(locale))
CFLAGS += -DHAVE_LOCALE
endif
# Always have some debugging information.
CFLAGS += -g
ifeq ($(DEBUG), 1)

View File

@ -22,6 +22,10 @@
#include <stdlib.h>
#include <unistd.h>
#ifdef HAVE_LOCALE
#include <locale.h>
#endif
#include <mpv/client.h>
#include <mpv/opengl_cb.h>
@ -163,6 +167,10 @@ static void context_reset(void)
{
const char *cmd[] = {"loadfile", filepath, NULL};
#ifdef HAVE_LOCALE
setlocale(LC_NUMERIC, "C");
#endif
mpv = mpv_create();
if(!mpv)