[vlc-commits] network: convert "ipv4-timeout" in ms to ticks using VLC_TICK macros
Steve Lhomme
git at videolan.org
Tue Jul 3 11:24:11 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jul 3 11:21:41 2018 +0200| [e9d517c3b629711da4a7d6998b004705c0cdaf22] | committer: Steve Lhomme
network: convert "ipv4-timeout" in ms to ticks using VLC_TICK macros
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e9d517c3b629711da4a7d6998b004705c0cdaf22
---
src/network/tcp.c | 3 +--
src/network/tls.c | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/network/tcp.c b/src/network/tcp.c
index a006ba94e4..007a9c813b 100644
--- a/src/network/tcp.c
+++ b/src/network/tcp.c
@@ -136,8 +136,7 @@ int net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port,
}
free( psz_socks );
- vlc_tick_t timeout = var_InheritInteger(p_this, "ipv4-timeout")
- * (CLOCK_FREQ / 1000);
+ vlc_tick_t timeout = VLC_TICK_FROM_MS( var_InheritInteger(p_this, "ipv4-timeout") );
for (struct addrinfo *ptr = res; ptr != NULL; ptr = ptr->ai_next)
{
diff --git a/src/network/tls.c b/src/network/tls.c
index 3650095394..473b36ab89 100644
--- a/src/network/tls.c
+++ b/src/network/tls.c
@@ -168,7 +168,7 @@ vlc_tls_t *vlc_tls_ClientSessionCreate(vlc_tls_creds_t *crd, vlc_tls_t *sock,
int canc = vlc_savecancel();
vlc_tick_t deadline = vlc_tick_now ();
- deadline += var_InheritInteger (crd, "ipv4-timeout") * 1000;
+ deadline += VLC_TICK_FROM_MS( var_InheritInteger (crd, "ipv4-timeout") );
struct pollfd ufd[1];
ufd[0].fd = vlc_tls_GetFD(sock);
More information about the vlc-commits
mailing list