1 Copyright (C) 2008 Rémi Denis-Courmont, adaptation by Felix Kühne (C) 2009.
2 Licensed under GNU General Public License version 2 or higher.
3 diff -ru live-orig/config.mingw live/config.mingw
4 --- live-orig/config.mingw 2009-02-13 09:09:42.000000000 +0100
5 +++ live/config.mingw 2009-02-20 14:17:20.000000000 +0100
7 -COMPILE_OPTS = $(INCLUDES) -I. -O -DSOCKLEN_T=int
8 +COMPILE_OPTS = $(INCLUDES) -I. -O -DSOCKLEN_T=int -DLOCALE_NOT_USED
11 C_FLAGS = $(COMPILE_OPTS) -DUSE_OUR_BZERO=1 -D__MINGW32__
12 diff -ru live-orig/liveMedia/Locale.cpp live/liveMedia/Locale.cpp
13 --- live-orig/liveMedia/Locale.cpp 2009-02-13 09:09:42.000000000 +0100
14 +++ live/liveMedia/Locale.cpp 2009-02-20 14:17:20.000000000 +0100
19 -Locale::Locale(char const* newLocale, int category)
20 - : fCategory(category) {
21 +Locale::Locale(char const* newLocale, int category) {
22 #ifndef LOCALE_NOT_USED
23 - fPrevLocale = strDup(setlocale(category, NULL));
24 - setlocale(category, newLocale);
25 + fLocale = newlocale(category, newLocale, NULL);
26 + fPrevLocale = uselocale(fLocale);
31 #ifndef LOCALE_NOT_USED
32 - if (fPrevLocale != NULL) {
33 - setlocale(fCategory, fPrevLocale);
34 - delete[] fPrevLocale;
35 + if (fLocale != (locale_t)0) {
36 + uselocale(fPrevLocale);
37 + freelocale(fLocale);
41 diff -ru live-orig/liveMedia/RTSPClient.cpp live/liveMedia/RTSPClient.cpp
42 --- live-orig/liveMedia/RTSPClient.cpp 2009-02-13 09:09:42.000000000 +0100
43 +++ live/liveMedia/RTSPClient.cpp 2009-02-20 14:27:06.000000000 +0100
45 // This is the default value; we don't need a "Scale:" header:
48 - Locale l("C", LC_NUMERIC);
49 + Locale l("C", LC_NUMERIC_MASK);
50 sprintf(buf, "Scale: %f\r\n", scale);
53 @@ -1033,11 +1033,11 @@
56 // There's no end time:
57 - Locale l("C", LC_NUMERIC);
58 + Locale l("C", LC_NUMERIC_MASK);
59 sprintf(buf, "Range: npt=%.3f-\r\n", start);
61 // There's both a start and an end time; include them both in the "Range:" hdr
62 - Locale l("C", LC_NUMERIC);
63 + Locale l("C", LC_NUMERIC_MASK);
64 sprintf(buf, "Range: npt=%.3f-%.3f\r\n", start, end);
68 if (_strncasecmp(line, "Scale: ", 7) != 0) return False;
71 - Locale l("C", LC_NUMERIC);
72 + Locale l("C", LC_NUMERIC_MASK);
73 return sscanf(line, "%f", &scale) == 1;
76 diff -ru live-orig/liveMedia/RTSPCommon.cpp live/liveMedia/RTSPCommon.cpp
77 --- live-orig/liveMedia/RTSPCommon.cpp 2009-02-13 09:09:42.000000000 +0100
78 +++ live/liveMedia/RTSPCommon.cpp 2009-02-20 14:26:01.000000000 +0100
80 char const* fields = buf + 7;
81 while (*fields == ' ') ++fields;
83 - Locale l("C", LC_NUMERIC);
84 + Locale l("C", LC_NUMERIC_MASK);
85 if (sscanf(fields, "npt = %lf - %lf", &start, &end) == 2) {
88 diff -ru live-orig/liveMedia/include/Locale.hh live/liveMedia/include/Locale.hh
89 --- live-orig/liveMedia/include/Locale.hh 2009-02-13 09:09:42.000000000 +0100
90 +++ live/liveMedia/include/Locale.hh 2009-02-20 14:17:20.000000000 +0100
93 #ifndef LOCALE_NOT_USED
102 +#define LC_ALL_MASK 0
105 -#define LC_NUMERIC 4
106 +#ifndef LC_NUMERIC_MASK
107 +#define LC_NUMERIC_MASK 0
109 +typedef int locale_t;
114 - Locale(char const* newLocale, int category = LC_ALL);
115 + Locale(char const* newLocale, int category = LC_ALL_MASK);
121 + locale_t fLocale, fPrevLocale;