[vlc-devel] [PATCH] Add libvlc_media_list_player_retain() to libvlc.

Alexey Sokolov alexey at alexeysokolov.co.cc
Tue May 31 12:20:34 CEST 2011


On 31.05.2011 17:15, Rémi Denis-Courmont wrote:
> On Tue, 31 May 2011 16:02:40 +0700, Alexey Sokolov
> <alexey at alexeysokolov.co.cc>  wrote:
>> Hi.
>>
>> There was only release() before.
> Hmm, I don't know if it makes that much sense...
> In what scenarii would there be more than one "thing" referencing a single
> media player?
>
In C++ bindings which I'm currently writing.

class MediaListPlayer {
     libvlc_media_list_player_t* m_obj;
public:
     MediaListPlayer(libvlc_media_list_player_t* obj) { m_obj = obj; } 
//<- this stoles obj
     ~MediaListPlayer() { libvlc_media_list_player_release(m_obj); }
     ... //<- other methods
};

And there's no (obvious) way without retain() to reuse reference to 
libvlc_media_list_player_t after it being stolen by the object.

-- 
Best regards,
Alexey "DarthGandalf" Sokolov




More information about the vlc-devel mailing list