Fixed a bug which would prevent proper parsing of floating point

options when the locale used has a decimal point other than the dot
character (".").
Idea by Aleksander Adamowski <olo at altkom dor com dot pl>.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8084 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
rguyom 2002-11-03 15:14:31 +00:00
parent d80fc3aa45
commit 8c126714c5
1 changed files with 10 additions and 0 deletions

View File

@ -27,6 +27,10 @@
#include "../mp_msg.h"
#include "../cpudetect.h"
#ifdef USE_SETLOCALE
#include <locale.h>
#endif
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
@ -265,7 +269,13 @@ static void parse( FilterParam *fp, char* args ) {
// parse amount
pos = strchr( pos+1, ':' );
#ifdef USE_SETLOCALE
setlocale( LC_NUMERIC, "C" );
#endif
fp->amount = ( pos && pos+1<max ) ? atof( pos+1 ) : 0;
#ifdef USE_SETLOCALE
setlocale( LC_NUMERIC, "" );
#endif
}
//===========================================================================//