[vlc-devel] [Patch] Sending a signal when a vout is created/destroyed

Hugo Beauzee-Luyssen beauze.h at gmail.com
Wed Jan 20 14:35:49 CET 2010

2010/1/20 Rémi Denis-Courmont <remi at remlab.net>:
>   Hello,
> On Wed, 20 Jan 2010 00:13:49 +0100, Hugo Beauzee-Luyssen
> <beauze.h at gmail.com> wrote:
>> This patchs adds a libvlc_MediaPlayerVoutChanged event, that let an
>> application using libvlc know when a vout has been created.
>> This can be usefull when trying to know the width or height of a
>> media, using libvlc_video_get_width/height, as these functions
>> immediatly return when no vout has been spawned.
> It's none of the LibVLC application business when a video output is
> created; that's an internal implementation detail. It should only care that
> there is a new elementary stream. Hence I think that event does not deserve
> to exist.

I do agree that it should be none of libvlc's business. However, in
video.c you have :

int height;
vout_thread_t *p_vout = GetVout( p_mi, p_e );
if( !p_vout ) return 0;

If we don't have a way of knowing the vout has been created, the only
remaining solution is to loop until get_width/height returns a non 0
If anything goes wrong, let's say the decoder isn't found, or the
video is screwed for any reason, get_width/height will never return
anything but 0, causing an infinite loop.

If you think of another solution, i'd be glad to use it and to forget
this patch.


Hugo Beauzée-Luyssen

More information about the vlc-devel mailing list