[vlc-devel] libvlc_MediaMetaChanged event being sent too soon
Pierre d'Herbemont
pdherbemont at free.fr
Sat Jul 10 17:31:43 CEST 2010
On Sat, Jul 10, 2010 at 1:17 AM, Jason Butler <jbutler at hcn-inc.com> wrote:
> I am using libvlc 1.1.0 to play an audio steam on Linux. I want to get the
> title, album, and artist every time the track changes so I am hooking up a
> callback function to the libvlc_MediaMetaChanged event. The problem is when
> the stream starts playing the libvlc_MediaMetaChanged event is sent serveral
> times before all the track meta data is valid. If I call
> libvlc_media_get_meta(m,libvlc_meta_Artist), or
> libvlc_media_get_meta(m,libvlc_meta_Album) too soon then I get a segment
> fault. I thought about waiting for the libvlc_MediaPlayerPlaying event but
> libvlc_MediaMetaChanged event is still sent several times before the album
> and artist data is valid.
>
> Is there a way to check if the artist and album data is valid before calling
> libvlc_media_get_meta?
There is the meta_type field in the libvlc_event_t that describes what
meta (artist...) has changed. This should be what your are looking
for.
Pierre.
More information about the vlc-devel
mailing list