Do not parse --max-fps float in the client

Many parsing and formatting C functions like strtof() and asprintf() are
locale-dependent. Forcing a C locale just for the conversions in a way
that works on all platforms is a mess.

In practice, this is not a problem, scrcpy always uses the C locale,
because it never calls:

    setlocale(LC_ALL, "");

But the max-fps option should not depend on the locale configuration
anyway.

Since the value is parsed by the client in Java anyway, just forward the
string value as is.
This commit is contained in:
Romain Vimont
2024-09-14 14:32:32 +02:00
parent 265a15e0b1
commit 1d713d7598
8 changed files with 7 additions and 67 deletions

View File

@@ -66,14 +66,6 @@ sc_str_parse_integers(const char *s, const char sep, size_t max_items,
bool
sc_str_parse_integer_with_suffix(const char *s, long *out);
/**
* `Parse `s` as a float into `out`
*
* Return true if the conversion succeeded, false otherwise.
*/
bool
sc_str_parse_float(const char *s, float *out);
/**
* Search `s` in the list separated by `sep`
*