[vlc-devel] [PATCH] udp: adjust receive buffer for windows 7 and earlier

Tristan Matthews tmatth at videolan.org
Thu Mar 19 15:18:03 CET 2015


On Thu, Mar 19, 2015 at 8:28 AM, Ilkka Ollakka <ileoo at videolan.org> wrote:
> Try to detect runtime our windows version.
> Fixes #14200
> ---
>  src/network/udp.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/src/network/udp.c b/src/network/udp.c
> index b2c8a50..98bae46 100644
> --- a/src/network/udp.c
> +++ b/src/network/udp.c
> @@ -97,6 +97,21 @@ static int net_SetupDgramSocket (vlc_object_t *p_obj, int fd,
>  #endif
>
>  #if defined (_WIN32)
> +
> +    /* Check windows version so we know if we need to increase receive buffers
> +     * for Windows 7 and ealier

"earlier"

> +
> +     * SetSocketMediaStreamingMode is present in win 8 and later, so we set
> +     * receive buffer if that isn't present
> +     */
> +    if( dlsym( RTLD_DEFAULT, "SetSocketMediaStreamingMode" ) == NULL )
> +    {
> +        setsockopt (fd, SOL_SOCKET, SO_RCVBUF,
> +                         (void *)&(int){ 0x80000 }, sizeof (int));
> +    }
> +    /* Cleanup the dlsym possible error state */
> +    dlerror();
> +
>      if (net_SockAddrIsMulticast (ptr->ai_addr, ptr->ai_addrlen)
>       && (sizeof (struct sockaddr_storage) >= ptr->ai_addrlen))
>      {
> --
> 2.3.3
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



More information about the vlc-devel mailing list