[vlc-devel] [PATCH] Add methods to libvlc to enable and query recording of current media:

Rémi Denis-Courmont remi at remlab.net
Sun Jul 29 16:40:01 CEST 2012


Le dimanche 29 juillet 2012 17:19:03 Mark Lee, vous avez écrit :
> Hello...
> 
> On 29 July 2012 14:49, Rémi Denis-Courmont <remi at remlab.net> wrote:
> > Le dimanche 29 juillet 2012 16:30:15 Mark Lee, vous avez écrit :
> > > +/**
> > > + * Can the media player record the current media?
> > > + *
> > > + * Media must be playing or buffering before it can be recorded.
> > > + *
> > > + * \param p_mi media player
> > > + * \return non-zero if the media player can record, zero if it can not
> > > + * \version LibVLC 2.1.0 or later
> > > + */
> > > +LIBVLC_API int libvlc_media_player_can_record( libvlc_media_player_t
> > 
> > *p_mi
> > 
> > > );
> > 
> > I don't see how that's supposed to work. How does the caller know when to
> > call
> > the function? How does the caller know that the state has not changed
> > since it
> > checked the result of the function? This function seems intrinsically
> > broken
> > by design.
> 
> As to when: the caller could query this on receipt of a buffering or
> playing event. Similarly if an event like stopped or media changed is
> received then the caller would know the old state was no longer valid. Is
> that approach not acceptable?

I don't know. But whatever the method, it needs to be specified in the Doxygen 
documentation.

> As to the state changing: I did not expect that the state of this variable
> would change whilst the media was playing, but I suppose I don't know
> enough about vlc to be sure.
> 
> Anyway, do you think it is simply useless to include this function or
> should it be fixed somehow?

I don't know. But without proper documentation it is useless.


-- 
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis



More information about the vlc-devel mailing list