[vlc-devel] [PATCH 4/4] chromecast: add an experimental sout module that connects to a ChromeCast device and streams using the HTTP access output

Ilkka Ollakka ileoo at videolan.org
Sat Aug 30 17:08:58 CEST 2014


On Thu, Aug 28, 2014 at 09:08:35AM +0200, Adrien Maglo wrote:

Hi, one comment inline

>  modules/stream_out/chromecast/cast.cpp | 892 +++++++++++++++++++++++++++++++++
> +++ b/modules/stream_out/chromecast/cast.cpp
> +
> +/**
> + * @brief Receive a data packet from the Chromecast
> + * @param p_stream the sout_stream_t structure
> + * @param b_msgReceived returns true if a message has been entirely received else false
> + * @param i_payloadSize returns the payload size of the message received
> + * @return the number of bytes received of -1 on error
> + */
> +static int recvPacket(sout_stream_t *p_stream, bool &b_msgReceived,
> +                      uint32_t &i_payloadSize)
> +{
> +    // Use here only C linkage and POD types as this function is a cancelation point.
> +    sout_stream_sys_t *p_sys = p_stream->p_sys;
> +    struct pollfd ufd[1];
> +    ufd[0].fd = p_sys->i_sock_fd;
> +    ufd[0].events = POLLIN;
> +
> +    mtime_t deadline = mdate();
> +    deadline += 6 * 1000 * 1000; // 6 seconds
> +
> +    mtime_t now = mdate();
> +    if (now > deadline)
> +        now = deadline;

This caught my eye, are you checking if mdate() takes more than 6
seconds in here? looks odd and maybe there isn't need to call mdate
twice per recvPacket call?

-- 
Ilkka Ollakka
You cannot kill time without injuring eternity.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20140830/a009b36b/attachment.sig>


More information about the vlc-devel mailing list