> Hi!
>
> I accidentally found an issue that probably caused several bug reports 
> against movit!
>
> Looks like it does not correctly handle locales (the infamous dot/comma 
> issue)...
>
> Playing a clip in terminal:
>
> melt myclip.mp4 .glsl=1 -attach movit.saturation saturation=0  -consumer 
> xgl
>
> Works fine.
> But if I use a locale with comma separator:
>
> LC_ALL=fr_FR.UTF-8 melt myclip.mp4 .glsl=1 -attach movit.saturation 
> saturation=0  -consumer xgl
>
> I get the following:
> Movit system requirements: Needs at least GLSL version 1.30 (has version 
> 1,0)
> [filter avcolor_space] Invalid format glsl
>
> It clearly looks like the locale is not handled correctly, making it 
> believe it has an older GLSL (1.0) version. Not sure if the problem is in 
> MLT or in movit, will keep you posted if I find where it is.


After some tests, here is a solution:
When used through MLT, Movit's locale is set to the current user's locale.
The version check is than made in movit (init.cpp) with an atof with is 
locale sensitive.

So trying to parse "1.30" fails on comma as numerical separator.

Patching movit with the patch below fixes the problem for me (patch against 
movit git master).

Regards,
jb

diff --git a/init.cpp b/init.cpp
index b9e68ab..30a323a 100644
--- a/init.cpp
+++ b/init.cpp
@@ -379,7 +379,10 @@ double get_glsl_version()
        // Now we have something on the form X.YY. We convert it to a 
float, and hope
        // that if it's inexact (e.g. 1.30), atof() will round the same way 
the
        // compiler will.
-       float glsl_version = atof(glsl_version_str);
+        std::istringstream locale_convert(glsl_version_str);
+        locale_convert.imbue(std::locale("C"));
+        double glsl_version;
+        locale_convert >> glsl_version;
        free(glsl_version_str);
 
        return glsl_version;



------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to