    if (_strncasecmp(line, "Scale: ", 7) != 0) return False;
    line += 7;
  
--  Locale("C", LC_NUMERIC);
-+  Locale("C", LC_NUMERIC_MASK);
+-  Locale l("C", LC_NUMERIC);
++  Locale l("C", LC_NUMERIC_MASK);
    return sscanf(line, "%f", &scale) == 1;
  }
  
+diff -urN live.orig/liveMedia/RTSPCommon.cpp live/liveMedia/RTSPCommon.cpp
+--- live.orig/liveMedia/RTSPCommon.cpp	2009-03-23 01:26:16 +0300
++++ live/liveMedia/RTSPCommon.cpp	2009-03-26 19:23:25 +0300
+@@ -146,7 +146,7 @@
+   char const* fields = buf + 7;
+   while (*fields == ' ') ++fields;
+   double start, end;
+-  Locale l("C", LC_NUMERIC);
++  Locale l("C", LC_NUMERIC_MASK);
+   if (sscanf(fields, "npt = %lf - %lf", &start, &end) == 2) {
+     rangeStart = start;
+     rangeEnd = end;

     buf[0] = '\0';
   } else if (end < 0) {
     // There's no end time:
-    Locale("C", LC_NUMERIC);
+    Locale("C", LC_NUMERIC_MASK);
     sprintf(buf, "Range: npt=%.3f-\r\n", start);
   } else {
     // There's both a start and an end time; include them both in the "Range:" hdr
-    Locale("C", LC_NUMERIC);
+    Locale("C", LC_NUMERIC_MASK);
     sprintf(buf, "Range: npt=%.3f-%.3f\r\n", start, end);
   }
 

 };
 
 #endif
diff -urN live.orig/liveMedia/Locale.cpp live/liveMedia/Locale.cpp
--- live.orig/liveMedia/Locale.cpp	2009-03-23 01:26:16 +0300
+++ live/liveMedia/Locale.cpp	2009-03-26 19:17:43 +0300
@@ -22,19 +22,18 @@
 #include "Locale.hh"
 #include <strDup.hh>
 
-Locale::Locale(char const* newLocale, int category)
-  : fCategory(category) {
+Locale::Locale(char const* newLocale, int category) {
 #ifndef LOCALE_NOT_USED
-  fPrevLocale = strDup(setlocale(category, NULL));
-  setlocale(category, newLocale);
+  fLocale = newlocale(category, newLocale, NULL);
+  fPrevLocale = uselocale(fLocale);
 #endif
 }
 
 Locale::~Locale() {
 #ifndef LOCALE_NOT_USED
-  if (fPrevLocale != NULL) {
-    setlocale(fCategory, fPrevLocale);
-    delete[] fPrevLocale;
+  if (fLocale != (locale_t)0) {
+    uselocale(fPrevLocale);
+    freelocale(fLocale);
   }
 #endif
 }
diff -urN live.orig/liveMedia/RTSPClient.cpp live/liveMedia/RTSPClient.cpp
--- live.orig/liveMedia/RTSPClient.cpp	2009-03-23 01:26:16 +0300
+++ live/liveMedia/RTSPClient.cpp	2009-03-26 19:29:38 +0300
@@ -1019,7 +1019,7 @@
     // This is the default value; we don't need a "Scale:" header:
     buf[0] = '\0';
   } else {
-    Locale l("C", LC_NUMERIC);
+    Locale l("C", LC_NUMERIC_MASK);
     sprintf(buf, "Scale: %f\r\n", scale);
   }
 
