Video effects and LC_NUMERIC

There is a problem with video effects and Polish localization.

I'm not sure if I post to the correct forum, but it's definitely not a Translation issue.

In LC_NUMERIC=pl_PL, comma stands as decimal point (pi is "3,14159", not "3.14159").

1. The kdenlive itself, when passes knob values and other variables (like "brightness", "contrast", "start") to video effects, apparently ignores the locale and serializes them with point as decimal point, e.g. brightness as string "0.9". (I observed this)

2. The mlt, however, does apply the locale when parsing these strings, and expects ',' as decimal point, not '.'; it's because it calls atof() from glibc, which in turn is locale-aware and with LC_NUMERIC=pl_PL, atof("0.9") returns 0, not 0.9 (to get 0.9, one should call atof("0,9")). Therefore, for any serialized x, it returns Entier(x) of x instead of x itself. (I traced this)

3. frei0r apparently is also locale-aware and expects commas. (I observed this)

The overall effects of above is that hardly any effect works properly. For example, "brightness (keyframable)" generates a pitch black image for brightness

The workaround is to always run kdenlive with LC_NUMERIC=C. (works for me)

The caveat is that all *.kdenlive projects created with LC_NUMERIC=pl_PL need some perling or seding to convert all numbers from "x,xxx" to "", otherwise they will not open properly with LC_NUMERIC=C. (I tried this with my files)

Grzegorz Borowiak

* I'm not sure if I post to the correct forum, but this definitely has nothing to do with Translation.

To avoid such problems in mainwindow.cpp we do the following:

setlocale(LC_NUMERIC, "POSIX");

Not sure why it does not work in your case.