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 --- live/liveMedia/RTSPCommon.cpp.orig 2009-01-26 20:18:41.000000000 +0100
42 +++ live/liveMedia/RTSPCommon.cpp 2009-03-25 20:35:43.000000000 +0100
44 char const* fields = buf + 7;
45 while (*fields == ' ') ++fields;
47 - Locale("C", LC_NUMERIC);
48 + Locale("C", LC_NUMERIC_MASK);
49 if (sscanf(fields, "npt = %lf - %lf", &start, &end) == 2) {
51 rangeEnd = end;diff -ru live-orig/liveMedia/RTSPCommon.cpp live/liveMedia/RTSPCommon.cpp
52 diff -ru live-orig/liveMedia/include/Locale.hh live/liveMedia/include/Locale.hh
53 --- live-orig/liveMedia/include/Locale.hh 2009-02-13 09:09:42.000000000 +0100
54 +++ live/liveMedia/include/Locale.hh 2009-02-20 14:17:20.000000000 +0100
57 #ifndef LOCALE_NOT_USED
66 +#define LC_ALL_MASK 0
70 +#ifndef LC_NUMERIC_MASK
71 +#define LC_NUMERIC_MASK 0
73 +typedef int locale_t;
78 - Locale(char const* newLocale, int category = LC_ALL);
79 + Locale(char const* newLocale, int category = LC_ALL_MASK);
85 + locale_t fLocale, fPrevLocale;
89 --- live/liveMedia/RTSPClient.cpp.orig 2009-01-26 20:18:41.000000000 +0100
90 +++ live/liveMedia/RTSPClient.cpp 2009-03-25 20:35:18.000000000 +0100
92 // This is the default value; we don't need a "Scale:" header:
95 - Locale("C", LC_NUMERIC);
96 + Locale("C", LC_NUMERIC_MASK);
97 sprintf(buf, "Scale: %f\r\n", scale);
100 @@ -1033,11 +1033,11 @@
102 } else if (end < 0) {
103 // There's no end time:
104 - Locale("C", LC_NUMERIC);
105 + Locale("C", LC_NUMERIC_MASK);
106 sprintf(buf, "Range: npt=%.3f-\r\n", start);
108 // There's both a start and an end time; include them both in the "Range:" hdr
109 - Locale("C", LC_NUMERIC);
110 + Locale("C", LC_NUMERIC_MASK);
111 sprintf(buf, "Range: npt=%.3f-%.3f\r\n", start, end);
114 @@ -2342,7 +2342,7 @@
115 if (_strncasecmp(line, "Scale: ", 7) != 0) return False;
118 - Locale("C", LC_NUMERIC);
119 + Locale("C", LC_NUMERIC_MASK);
120 return sscanf(line, "%f", &scale) == 1;