[MPlayer-dev-eng] locale patches

Bohdan Horst nexus at irc.pl
Tue Nov 5 11:48:15 CET 2002


a few locale patches to VF (fix locales with "," separator)

best regards

-- 
 /  irl: Bohdan 'Nexus' Horst  |  irc: Nexus  \
{----------------------v-------^---------------}
 \ http://irc.pl/nexus | mailto: nexus at irc.pl /
-------------- next part --------------
--- vf_dint.c	Mon Oct  7 10:26:43 2002
+++ vf_dint.c	Tue Nov  5 11:38:03 2002
@@ -11,6 +11,10 @@
 #include "img_format.h"
 #include "vf.h"
 
+#ifdef USE_SETLOCALE
+#include <locale.h>
+#endif
+
 struct vf_priv_s {
   float sense; // first parameter
   float level; // second parameter
@@ -181,8 +185,15 @@
     vf->priv->sense = 0.1;
     vf->priv->level = 0.15;
     vf->priv->pmpi = NULL;
-    if (args)
+    if (args) {
+#ifdef USE_SETLOCALE
+      setlocale( LC_NUMERIC, "C" );
+#endif
       sscanf (args, "%f:%f", &vf->priv->sense, &vf->priv->level);
+#ifdef USE_SETLOCALE
+      setlocale( LC_NUMERIC, "" );
+#endif
+    }
     return 1;
 }
 
-------------- next part --------------
--- vf_fame.c	Tue Oct  1 10:53:37 2002
+++ vf_fame.c	Tue Nov  5 11:38:49 2002
@@ -18,6 +18,10 @@
 //#include "../libvo/fastmemcpy.h"
 #include "../libfame/fame.h"
 
+#ifdef USE_SETLOCALE
+#include <locale.h>
+#endif
+
 struct vf_priv_s {
     unsigned char* outbuf;
     int outbuf_size;
@@ -108,8 +112,15 @@
     }
 
     // TODO: parse args ->
-    if(args) sscanf(args, "%d:%f", &p_quality, &p_fps);
-
+    if(args) {
+#ifdef USE_SETLOCALE
+      setlocale( LC_NUMERIC, "C" );
+#endif
+      sscanf(args, "%d:%f", &p_quality, &p_fps);
+#ifdef USE_SETLOCALE
+      setlocale( LC_NUMERIC, "" );
+#endif
+    }
     if(p_quality<=100){
 	// fixed quality
 	vf->priv->params.quality=p_quality?p_quality:QUALITY;
-------------- next part --------------
--- vf_lavc.c	Fri Oct 25 11:48:05 2002
+++ vf_lavc.c	Tue Nov  5 11:39:13 2002
@@ -21,6 +21,10 @@
 #include "libavcodec/avcodec.h"
 #endif
 
+#ifdef USE_SETLOCALE
+#include <locale.h>
+#endif
+
 extern int avcodec_inited;
 
 struct vf_priv_s {
@@ -145,7 +149,15 @@
     vf->priv->context=avcodec_alloc_context();
 
     // TODO: parse args ->
-    if(args) sscanf(args, "%d:%f", &p_quality, &p_fps);
+    if(args) {
+#ifdef USE_SETLOCALE
+      setlocale( LC_NUMERIC, "C" );
+#endif
+      sscanf(args, "%d:%f", &p_quality, &p_fps);
+#ifdef USE_SETLOCALE
+      setlocale( LC_NUMERIC, "" );
+#endif
+    }
 
     if(p_quality<32){
 	// fixed qscale
-------------- next part --------------
--- vf_sab.c	Mon Nov  4 17:41:59 2002
+++ vf_sab.c	Tue Nov  5 11:39:40 2002
@@ -35,6 +35,9 @@
 #include "../libvo/fastmemcpy.h"
 #include "../postproc/swscale.h"
 
+#ifdef USE_SETLOCALE
+#include <locale.h>
+#endif
 
 //===========================================================================//
 
@@ -281,6 +284,9 @@
 
 	if(args==NULL) return 0;
 	
+#ifdef USE_SETLOCALE
+        setlocale( LC_NUMERIC, "C" );
+#endif
 	e=sscanf(args, "%f:%f:%f:%f:%f:%f",
 		&vf->priv->luma.radius,
 		&vf->priv->luma.preFilterRadius,
@@ -289,6 +295,9 @@
 		&vf->priv->chroma.preFilterRadius,
 		&vf->priv->chroma.strength
 		);
+#ifdef USE_SETLOCALE
+        setlocale( LC_NUMERIC, "" );
+#endif
 
 	vf->priv->luma.quality = vf->priv->chroma.quality= 3.0;
 	
-------------- next part --------------
--- vf_smartblur.c	Mon Nov  4 21:39:27 2002
+++ vf_smartblur.c	Tue Nov  5 11:40:22 2002
@@ -35,6 +35,10 @@
 #include "../libvo/fastmemcpy.h"
 #include "../postproc/swscale.h"
 
+#ifdef USE_SETLOCALE
+#include <locale.h>
+#endif
+
 //===========================================================================//
 
 typedef struct FilterParam{
@@ -230,6 +234,9 @@
 
 	if(args==NULL) return 0;
 	
+#ifdef USE_SETLOCALE
+        setlocale( LC_NUMERIC, "C" );
+#endif
 	e=sscanf(args, "%f:%f:%d:%f:%f:%d",
 		&vf->priv->luma.radius,
 		&vf->priv->luma.strength,
@@ -238,6 +245,9 @@
 		&vf->priv->chroma.strength,
 		&vf->priv->chroma.threshold
 		);
+#ifdef USE_SETLOCALE
+        setlocale( LC_NUMERIC, "" );
+#endif
 
 	vf->priv->luma.quality = vf->priv->chroma.quality= 3.0;
 	


More information about the MPlayer-dev-eng mailing list