[vlc-devel] [PATCH v2 5/5] upnp: Add UPnP/DLNA MediaRenderer control plugin

Jean-Baptiste Kempf jb at videolan.org
Tue Jul 16 10:37:39 CEST 2019


Yo,

On Tue, Jul 16, 2019, at 10:32, Johan Gunnarsson wrote:
> > Can't you use vlc_strftime for this?
> 
> Not sure I can. With format %H:%M:%S I can only support up media that
> is up to 24 hours long. Media that is, for example, 25 hours long
> should be printed as 25:00:00. Don't think I can do that with stftime.
> See section 2.2.14 in
> http://upnp.org/specs/av/UPnP-av-AVTransport-v1-Service.pdf for
> description of the output.

Ouch.

> > > +    vlc_player_t *player = vlc_playlist_GetPlayer(
> > > p_intf->p_sys->playlist );
> >
> > I would prefer a local (inline) function for the player getter to this module, in case we decide to use a different player, and that will be easier in the future if you do this.
> 
> My code is a bit inconsistent. I have player in intf_sys_t already. I
> suggest I use player in intf_sys_t instead. Then there will only be
> one spot where I do vlc_intf_GetMainPlaylist + vlc_playlist_GetPlayer.

That would be good.

> > > +    // TODO: get real status and speed
> > > +    out_params["CurrentTransportStatus"] = "";
> > > +    out_params["CurrentSpeed"] = "";
> >
> > Is that hard to get? (speed is rate in VLC)
> 
> OK, I will fix this.
> 
> >
> > > +        if( !strptime(in_params["Target"].c_str(), "%H:%M:%S", &tm) )
> > > +            return true;
> >
> > strptime is not everywhere. We have a check in the configure for that.
> 
> OK, I will see if I can use sscanf or something.

Or just use HAVE_STRPTIME (won't work on Windows, though)

-- 
Jean-Baptiste Kempf -  President
+33 672 704 734


More information about the vlc-devel mailing list