[Gambas-user] Trying to use libmpv, but got Segmentation faults on exit

Benoît Minisini gambas at ...1...
Sun Jan 18 17:49:52 CET 2015


Le 18/01/2015 17:46, Benoît Minisini a écrit :
> Le 17/01/2015 13:19, Antonio a écrit :
>> I managed to make the project archive i'm attaching right now.
>> You need to replace the string "loadfile videofile" with something
>> existing on your filesystem fo course.
>> Run the project, hit the button, wait 10 seconds, then close the form
>> and you'll get the error on exit.
>> Just replacing gb.qt with gb.gtk make it works.
>> playing an audio only file will work too.
>>
>> thanks for looking into this,
>>
>> --
>> Antonio Orefice
>>
>>
>
> Qt crashes because :
>
> - The libmpv library calls the X11 library inside threads.
>
> - The X11 library can be called from different threads only if it is
> explicitly initialized by the XInitThreads() method.
>
> - Qt4 does not call this method
>
> The X11 documentation tells that :
>
> - You must call this method before every other X11 function.
>
> - You must call this method only if really needed (because it slows down
> the library I imagine).
>
> So there is a problem: I can't know by advance that a shared library
> used at runtime would need that...
>

And note that gb.gtk and gb.gtk3 crash for the same reason. If it does 
not crash on your machine, it just that you are lucky.

Regards,

-- 
Benoît Minisini




More information about the User mailing list