[vlc-devel] Problem transporting psz (string) data with a libvlc event

Rémi Denis-Courmont rdenis at simphalempin.com
Fri Nov 7 12:31:30 CET 2008


On Fri, 7 Nov 2008 12:45:16 +0200, "basos g" <noxelia at gmail.com> wrote:
>  The problem is that i got a segi when i try to read the string data
> outside vlc (from the libvlc user thread). I have comfirmed that the
> psz_filename address is the same inside and outside of libvlc.
> Is there some point i'm missing about free storage concerning
> interthread transport ?

The last thread to use the data must free it. The libc heap is thread-safe.

> Is there a limitation for access rights on memmory allocated withing a
> thread from another ??

No.

> Or is there some implicit mechanism that might free the string data
> asynchronously while we are inside libvlc_event_send ?????

Doubt it.

In any case, I don't think yet another event is the right thing to do. A
blocking API sounds much more usable, and less bug-prone. That's how it's
done with mediacontrol already.

-- 
Rémi Denis-Courmont




More information about the vlc-devel mailing list