Sun May 13 09:44:03 2018 UTC ()
opusfile: update to 0.10. Fixes build with OpenSSL 1.1.x.

Changes since the v0.9 release:

    Fix an out-of-bounds read matching serial numbers.

Changes since the v0.8 release:

    Fix an invalid free with tag handling.
    Improve handling of corrupt streams.
    Improve performance on streams with many chain segments.
    Improve TLS host validation.
    Align op_raw_total to work better with op_raw_seek.
    Documentation and build improvements.

Changes since the v0.7 release:

    Add support for OpenSSL 1.1.x.
    Fix issues with tag parsing introduced in v0.7.
    Fix skip logic for multiplexed non-Opus data.


(maya)
diff -r1.6 -r1.7 pkgsrc/audio/opusfile/Makefile
diff -r1.3 -r1.4 pkgsrc/audio/opusfile/PLIST
diff -r1.8 -r1.9 pkgsrc/audio/opusfile/distinfo
diff -r1.1 -r1.2 pkgsrc/audio/opusfile/patches/patch-configure
diff -r1.1 -r1.2 pkgsrc/audio/opusfile/patches/patch-configure.ac
diff -r1.5 -r1.6 pkgsrc/audio/opusfile/patches/patch-src_http.c

cvs diff -r1.6 -r1.7 pkgsrc/audio/opusfile/Makefile (expand / switch to unified diff)

--- pkgsrc/audio/opusfile/Makefile 2016/03/13 08:04:06 1.6
+++ pkgsrc/audio/opusfile/Makefile 2018/05/13 09:44:03 1.7
@@ -1,17 +1,16 @@ @@ -1,17 +1,16 @@
1# $NetBSD: Makefile,v 1.6 2016/03/13 08:04:06 tnn Exp $ 1# $NetBSD: Makefile,v 1.7 2018/05/13 09:44:03 maya Exp $
2 2
3DISTNAME= opusfile-0.7 3DISTNAME= opusfile-0.10
4PKGREVISION= 1 
5CATEGORIES= audio 4CATEGORIES= audio
6MASTER_SITES= http://downloads.xiph.org/releases/opus/ 5MASTER_SITES= http://downloads.xiph.org/releases/opus/
7 6
8MAINTAINER= pkgsrc-users@NetBSD.org 7MAINTAINER= pkgsrc-users@NetBSD.org
9HOMEPAGE= http://opus-codec.org/ 8HOMEPAGE= http://opus-codec.org/
10COMMENT= Decoding and seeking API for opus files 9COMMENT= Decoding and seeking API for opus files
11LICENSE= modified-bsd 10LICENSE= modified-bsd
12 11
13GNU_CONFIGURE= yes 12GNU_CONFIGURE= yes
14USE_LIBTOOL= yes 13USE_LIBTOOL= yes
15USE_TOOLS+= gmake pkg-config 14USE_TOOLS+= gmake pkg-config
16 15
17PKGCONFIG_OVERRIDE+= opusfile.pc.in 16PKGCONFIG_OVERRIDE+= opusfile.pc.in

cvs diff -r1.3 -r1.4 pkgsrc/audio/opusfile/PLIST (expand / switch to unified diff)

--- pkgsrc/audio/opusfile/PLIST 2016/03/13 08:04:06 1.3
+++ pkgsrc/audio/opusfile/PLIST 2018/05/13 09:44:03 1.4
@@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
1@comment $NetBSD: PLIST,v 1.3 2016/03/13 08:04:06 tnn Exp $ 1@comment $NetBSD: PLIST,v 1.4 2018/05/13 09:44:03 maya Exp $
2include/opus/opusfile.h 2include/opus/opusfile.h
3lib/libopusfile.la 3lib/libopusfile.la
4lib/libopusurl.la 4lib/libopusurl.la
5lib/pkgconfig/opusfile.pc 5lib/pkgconfig/opusfile.pc
6lib/pkgconfig/opusurl.pc 6lib/pkgconfig/opusurl.pc
7share/doc/opusfile/AUTHORS 7share/doc/opusfile/AUTHORS
8share/doc/opusfile/COPYING 8share/doc/opusfile/COPYING
9share/doc/opusfile/README.txt 9share/doc/opusfile/README.md

cvs diff -r1.8 -r1.9 pkgsrc/audio/opusfile/distinfo (expand / switch to unified diff)

--- pkgsrc/audio/opusfile/distinfo 2016/03/07 19:36:57 1.8
+++ pkgsrc/audio/opusfile/distinfo 2018/05/13 09:44:03 1.9
@@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
1$NetBSD: distinfo,v 1.8 2016/03/07 19:36:57 nros Exp $ 1$NetBSD: distinfo,v 1.9 2018/05/13 09:44:03 maya Exp $
2 2
3SHA1 (opusfile-0.7.tar.gz) = 69dfca2092172f0837bb8b54dacfcb44fec6bd6f 3SHA1 (opusfile-0.10.tar.gz) = ddbeba72d45cde54872cc6811ae3273ed1520968
4RMD160 (opusfile-0.7.tar.gz) = 4acf7a9bf07e72c8e85e332724c410d767c00fa6 4RMD160 (opusfile-0.10.tar.gz) = b9fcc6fd243b45c853aa64137f006d71d0c7cc2b
5SHA512 (opusfile-0.7.tar.gz) = 13ad627e314c0f35f987d8170e090e0683d898f8c553f53a37b66a4401ff1843069e0adc35b32ef6f838d86a2a333bf11a37b4cf99161d34d5a7530619a3ade6 5SHA512 (opusfile-0.10.tar.gz) = 302601c31ca28bff175cefa99ac16177122a786d043be229616e2c98b7ffaf4a96b8bb17ca16e31240325a92763f417315b54d8f1b2f4f63f445cb7ad43c4a37
6Size (opusfile-0.7.tar.gz) = 463581 bytes 6Size (opusfile-0.10.tar.gz) = 467700 bytes
7SHA1 (patch-configure) = e66accedd8adbc6177b0abbec43b2d48b4a154c5 7SHA1 (patch-configure) = 27f0176b889eab6494e83b4d8cf2bdba1c03efa8
8SHA1 (patch-configure.ac) = d8384babab6d2e3e1fcf61380a8c3db70accf59d 8SHA1 (patch-configure.ac) = 7a49191176154c0e7f9fb0182e0dda7dfab8d39c
9SHA1 (patch-src_http.c) = 87aaa20b5fc6e7c07f40da47e47baee2833674f3 9SHA1 (patch-src_http.c) = 6b4f64a875c0fb5f9b9f63e041c232344c804dd3

cvs diff -r1.1 -r1.2 pkgsrc/audio/opusfile/patches/Attic/patch-configure (expand / switch to unified diff)

--- pkgsrc/audio/opusfile/patches/Attic/patch-configure 2015/11/20 14:28:02 1.1
+++ pkgsrc/audio/opusfile/patches/Attic/patch-configure 2018/05/13 09:44:03 1.2
@@ -1,18 +1,18 @@ @@ -1,18 +1,18 @@
1$NetBSD: patch-configure,v 1.1 2015/11/20 14:28:02 joerg Exp $ 1$NetBSD: patch-configure,v 1.2 2018/05/13 09:44:03 maya Exp $
2 2
3--- configure.orig 2015-11-18 13:16:26.000000000 +0000 3--- configure.orig 2017-11-14 18:56:39.000000000 +0000
4+++ configure 4+++ configure
5@@ -11897,70 +11897,6 @@ fi 5@@ -12491,64 +12488,6 @@ fi
6 fi 6 fi
7  7
8 fi 8 fi
9-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ftime" >&5 9-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ftime" >&5
10-$as_echo_n "checking for library containing ftime... " >&6; } 10-$as_echo_n "checking for library containing ftime... " >&6; }
11-if ${ac_cv_search_ftime+:} false; then : 11-if ${ac_cv_search_ftime+:} false; then :
12- $as_echo_n "(cached) " >&6 12- $as_echo_n "(cached) " >&6
13-else 13-else
14- ac_func_search_save_LIBS=$LIBS 14- ac_func_search_save_LIBS=$LIBS
15-cat confdefs.h - <<_ACEOF >conftest.$ac_ext 15-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16-/* end confdefs.h. */ 16-/* end confdefs.h. */
17- 17-
18-/* Override any GCC internal prototype to avoid an error. 18-/* Override any GCC internal prototype to avoid an error.
@@ -54,22 +54,16 @@ $NetBSD: patch-configure,v 1.1 2015/11/2 @@ -54,22 +54,16 @@ $NetBSD: patch-configure,v 1.1 2015/11/2
54-rm conftest.$ac_ext 54-rm conftest.$ac_ext
55-LIBS=$ac_func_search_save_LIBS 55-LIBS=$ac_func_search_save_LIBS
56-fi 56-fi
57-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ftime" >&5 57-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ftime" >&5
58-$as_echo "$ac_cv_search_ftime" >&6; } 58-$as_echo "$ac_cv_search_ftime" >&6; }
59-ac_res=$ac_cv_search_ftime 59-ac_res=$ac_cv_search_ftime
60-if test "$ac_res" != no; then : 60-if test "$ac_res" != no; then :
61- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" 61- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
62- 62-
63-else 63-else
64- enable_http=no 64- enable_http=no
65-fi 65-fi
66- 66-
67- 
68- 
69- 
70- 
71- 
72- 
73  67
74  68
75 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 69

cvs diff -r1.1 -r1.2 pkgsrc/audio/opusfile/patches/Attic/patch-configure.ac (expand / switch to unified diff)

--- pkgsrc/audio/opusfile/patches/Attic/patch-configure.ac 2015/11/20 14:28:02 1.1
+++ pkgsrc/audio/opusfile/patches/Attic/patch-configure.ac 2018/05/13 09:44:03 1.2
@@ -1,12 +1,12 @@ @@ -1,12 +1,12 @@
1$NetBSD: patch-configure.ac,v 1.1 2015/11/20 14:28:02 joerg Exp $ 1$NetBSD: patch-configure.ac,v 1.2 2018/05/13 09:44:03 maya Exp $
2 2
3--- configure.ac.orig 2015-11-18 13:16:13.000000000 +0000 3--- configure.ac.orig 2017-11-14 18:36:25.000000000 +0000
4+++ configure.ac 4+++ configure.ac
5@@ -86,7 +86,6 @@ AM_COND_IF(OP_WIN32, 5@@ -86,7 +86,6 @@ AM_COND_IF(OP_WIN32,
6 ) 6 )
7 ) 7 )
8 ) 8 )
9-AC_SEARCH_LIBS(ftime, [compat], , [enable_http=no]) 9-AC_SEARCH_LIBS(ftime, [compat], , [enable_http=no])
10  10
11 AS_IF([test "$enable_http" != "no"], [ 11 m4_ifndef([PKG_PROG_PKG_CONFIG],
12 openssl="openssl" 12 [m4_fatal([Could not locate the pkg-config autoconf macros.

cvs diff -r1.5 -r1.6 pkgsrc/audio/opusfile/patches/Attic/patch-src_http.c (expand / switch to unified diff)

--- pkgsrc/audio/opusfile/patches/Attic/patch-src_http.c 2016/03/07 19:36:57 1.5
+++ pkgsrc/audio/opusfile/patches/Attic/patch-src_http.c 2018/05/13 09:44:03 1.6
@@ -1,60 +1,60 @@ @@ -1,60 +1,60 @@
1$NetBSD: patch-src_http.c,v 1.5 2016/03/07 19:36:57 nros Exp $ 1$NetBSD: patch-src_http.c,v 1.6 2018/05/13 09:44:03 maya Exp $
2 2
3* Avoid using the obsolete ftime() function. 3* Avoid using the obsolete ftime() function.
4https://trac.xiph.org/ticket/2014 4https://trac.xiph.org/ticket/2014
5 5
6* Need sys/filio.h on SunOS for FIONREAD. 6* Need sys/filio.h on SunOS for FIONREAD.
7 7
8--- src/http.c.orig 2015-12-31 18:29:53.000000000 +0000 8--- src/http.c.orig 2017-08-03 00:27:06.000000000 +0000
9+++ src/http.c 9+++ src/http.c
10@@ -14,6 +14,9 @@ 10@@ -14,6 +14,9 @@
11 #endif 11 #endif
12  12
13 #include "internal.h" 13 #include "internal.h"
14+#ifdef __sun 14+#ifdef __sun
15+#include <sys/filio.h> 15+#include <sys/filio.h>
16+#endif 16+#endif
17 #include <ctype.h> 17 #include <ctype.h>
18 #include <errno.h> 18 #include <errno.h>
19 #include <limits.h> 19 #include <limits.h>
20@@ -347,7 +350,7 @@ typedef int op_sock; 20@@ -355,7 +358,7 @@ typedef int op_sock;
21 # define op_reset_errno() (errno=0) 21 # define op_reset_errno() (errno=0)
22  22
23 # endif 23 # endif
24-# include <sys/timeb.h> 24-# include <sys/timeb.h>
25+# include <sys/time.h> 25+# include <sys/time.h>
26 # include <openssl/x509v3.h> 26 # include <openssl/x509v3.h>
27  27
28 /*The maximum number of simultaneous connections. 28 /*The maximum number of simultaneous connections.
29@@ -788,7 +791,7 @@ struct OpusHTTPConn{ 29@@ -799,7 +802,7 @@ struct OpusHTTPConn{
30 /*The next connection in either the LRU or free list.*/ 30 /*The next connection in either the LRU or free list.*/
31 OpusHTTPConn *next; 31 OpusHTTPConn *next;
32 /*The last time we blocked for reading from this connection.*/ 32 /*The last time we blocked for reading from this connection.*/
33- struct timeb read_time; 33- struct timeb read_time;
34+ struct timeval read_time; 34+ struct timeval read_time;
35 /*The number of bytes we've read since the last time we blocked.*/ 35 /*The number of bytes we've read since the last time we blocked.*/
36 opus_int64 read_bytes; 36 opus_int64 read_bytes;
37 /*The estimated throughput of this connection, in bytes/s.*/ 37 /*The estimated throughput of this connection, in bytes/s.*/
38@@ -838,7 +841,7 @@ struct OpusHTTPStream{ 38@@ -849,7 +852,7 @@ struct OpusHTTPStream{
39 struct sockaddr_in6 v6; 39 struct sockaddr_in6 v6;
40 } addr; 40 } addr;
41 /*The last time we re-resolved the host.*/ 41 /*The last time we re-resolved the host.*/
42- struct timeb resolve_time; 42- struct timeb resolve_time;
43+ struct timeval resolve_time; 43+ struct timeval resolve_time;
44 /*A buffer used to build HTTP requests.*/ 44 /*A buffer used to build HTTP requests.*/
45 OpusStringBuf request; 45 OpusStringBuf request;
46 /*A buffer used to build proxy CONNECT requests.*/ 46 /*A buffer used to build proxy CONNECT requests.*/
47@@ -992,26 +995,26 @@ static int op_http_conn_estimate_availab 47@@ -1004,26 +1007,26 @@ static int op_http_conn_estimate_availab
48 return available; 48 return available;
49 } 49 }
50  50
51-static opus_int32 op_time_diff_ms(const struct timeb *_end, 51-static opus_int32 op_time_diff_ms(const struct timeb *_end,
52- const struct timeb *_start){ 52- const struct timeb *_start){
53+static opus_int32 op_time_diff_ms(const struct timeval *_end, 53+static opus_int32 op_time_diff_ms(const struct timeval *_end,
54+ const struct timeval *_start){ 54+ const struct timeval *_start){
55 opus_int64 dtime; 55 opus_int64 dtime;
56- dtime=_end->time-(opus_int64)_start->time; 56- dtime=_end->time-(opus_int64)_start->time;
57- OP_ASSERT(_end->millitm<1000); 57- OP_ASSERT(_end->millitm<1000);
58- OP_ASSERT(_start->millitm<1000); 58- OP_ASSERT(_start->millitm<1000);
59+ dtime=_end->tv_sec-(opus_int64)_start->tv_sec; 59+ dtime=_end->tv_sec-(opus_int64)_start->tv_sec;
60+ OP_ASSERT(_end->tv_usec<1000000); 60+ OP_ASSERT(_end->tv_usec<1000000);
@@ -69,107 +69,107 @@ https://trac.xiph.org/ticket/2014 @@ -69,107 +69,107 @@ https://trac.xiph.org/ticket/2014
69 static void op_http_conn_read_rate_update(OpusHTTPConn *_conn){ 69 static void op_http_conn_read_rate_update(OpusHTTPConn *_conn){
70- struct timeb read_time; 70- struct timeb read_time;
71+ struct timeval read_time; 71+ struct timeval read_time;
72 opus_int32 read_delta_ms; 72 opus_int32 read_delta_ms;
73 opus_int64 read_delta_bytes; 73 opus_int64 read_delta_bytes;
74 opus_int64 read_rate; 74 opus_int64 read_rate;
75 read_delta_bytes=_conn->read_bytes; 75 read_delta_bytes=_conn->read_bytes;
76 if(read_delta_bytes<=0)return; 76 if(read_delta_bytes<=0)return;
77- ftime(&read_time); 77- ftime(&read_time);
78+ gettimeofday(&read_time, NULL); 78+ gettimeofday(&read_time, NULL);
79 read_delta_ms=op_time_diff_ms(&read_time,&_conn->read_time); 79 read_delta_ms=op_time_diff_ms(&read_time,&_conn->read_time);
80 read_rate=_conn->read_rate; 80 read_rate=_conn->read_rate;
81 read_delta_ms=OP_MAX(read_delta_ms,1); 81 read_delta_ms=OP_MAX(read_delta_ms,1);
82@@ -1902,7 +1905,7 @@ static int op_sock_connect_next(op_sock  82@@ -2015,7 +2018,7 @@ static int op_sock_connect_next(op_sock
83 # define OP_NPROTOS (2) 83 # define OP_NPROTOS (2)
84  84
85 static int op_http_connect_impl(OpusHTTPStream *_stream,OpusHTTPConn *_conn, 85 static int op_http_connect_impl(OpusHTTPStream *_stream,OpusHTTPConn *_conn,
86- const struct addrinfo *_addrs,struct timeb *_start_time){ 86- struct addrinfo *_addrs,struct timeb *_start_time){
87+ const struct addrinfo *_addrs,struct timeval *_start_time){ 87+ struct addrinfo *_addrs,struct timeval *_start_time){
88 const struct addrinfo *addr; 88 struct addrinfo *addr;
89 const struct addrinfo *addrs[OP_NPROTOS]; 89 struct addrinfo *addrs[OP_NPROTOS];
90 struct pollfd fds[OP_NPROTOS]; 90 struct pollfd fds[OP_NPROTOS];
91@@ -1932,7 +1935,7 @@ static int op_http_connect_impl(OpusHTTP 91@@ -2045,7 +2048,7 @@ static int op_http_connect_impl(OpusHTTP
92 _stream->free_head=_conn->next; 92 _stream->free_head=_conn->next;
93 _conn->next=_stream->lru_head; 93 _conn->next=_stream->lru_head;
94 _stream->lru_head=_conn; 94 _stream->lru_head=_conn;
95- ftime(_start_time); 95- ftime(_start_time);
96+ gettimeofday(_start_time, NULL); 96+ gettimeofday(_start_time, NULL);
97 *&_conn->read_time=*_start_time; 97 *&_conn->read_time=*_start_time;
98 _conn->read_bytes=0; 98 _conn->read_bytes=0;
99 _conn->read_rate=0; 99 _conn->read_rate=0;
100@@ -2034,14 +2037,14 @@ static int op_http_connect_impl(OpusHTTP 100@@ -2147,14 +2150,14 @@ static int op_http_connect_impl(OpusHTTP
101 } 101 }
102  102
103 static int op_http_connect(OpusHTTPStream *_stream,OpusHTTPConn *_conn, 103 static int op_http_connect(OpusHTTPStream *_stream,OpusHTTPConn *_conn,
104- const struct addrinfo *_addrs,struct timeb *_start_time){ 104- struct addrinfo *_addrs,struct timeb *_start_time){
105- struct timeb resolve_time; 105- struct timeb resolve_time;
106+ const struct addrinfo *_addrs,struct timeval *_start_time){ 106+ struct addrinfo *_addrs,struct timeval *_start_time){
107+ struct timeval resolve_time; 107+ struct timeval resolve_time;
108 struct addrinfo *new_addrs; 108 struct addrinfo *new_addrs;
109 int ret; 109 int ret;
110 /*Re-resolve the host if we need to (RFC 6555 says we MUST do so 110 /*Re-resolve the host if we need to (RFC 6555 says we MUST do so
111 occasionally).*/ 111 occasionally).*/
112 new_addrs=NULL; 112 new_addrs=NULL;
113- ftime(&resolve_time); 113- ftime(&resolve_time);
114+ gettimeofday(&resolve_time, NULL); 114+ gettimeofday(&resolve_time, NULL);
115 if(_addrs!=&_stream->addr_info||op_time_diff_ms(&resolve_time, 115 if(_addrs!=&_stream->addr_info||op_time_diff_ms(&resolve_time,
116 &_stream->resolve_time)>=OP_RESOLVE_CACHE_TIMEOUT_MS){ 116 &_stream->resolve_time)>=OP_RESOLVE_CACHE_TIMEOUT_MS){
117 new_addrs=op_resolve(_stream->connect_host,_stream->connect_port); 117 new_addrs=op_resolve(_stream->connect_host,_stream->connect_port);
118@@ -2191,8 +2194,8 @@ static int op_http_stream_open(OpusHTTPS 118@@ -2305,8 +2308,8 @@ static int op_http_stream_open(OpusHTTPS
119 addrs=NULL; 119 addrs=NULL;
120 for(nredirs=0;nredirs<OP_REDIRECT_LIMIT;nredirs++){ 120 for(nredirs=0;nredirs<OP_REDIRECT_LIMIT;nredirs++){
121 OpusParsedURL next_url; 121 OpusParsedURL next_url;
122- struct timeb start_time; 122- struct timeb start_time;
123- struct timeb end_time; 123- struct timeb end_time;
124+ struct timeval start_time; 124+ struct timeval start_time;
125+ struct timeval end_time; 125+ struct timeval end_time;
126 char *next; 126 char *next;
127 char *status_code; 127 char *status_code;
128 int minor_version_pos; 128 int minor_version_pos;
129@@ -2321,7 +2324,7 @@ static int op_http_stream_open(OpusHTTPS 129@@ -2440,7 +2443,7 @@ static int op_http_stream_open(OpusHTTPS
130 if(OP_UNLIKELY(ret<0))return ret; 130 if(OP_UNLIKELY(ret<0))return ret;
131 ret=op_http_conn_read_response(_stream->conns+0,&_stream->response); 131 ret=op_http_conn_read_response(_stream->conns+0,&_stream->response);
132 if(OP_UNLIKELY(ret<0))return ret; 132 if(OP_UNLIKELY(ret<0))return ret;
133- ftime(&end_time); 133- ftime(&end_time);
134+ gettimeofday(&end_time, NULL); 134+ gettimeofday(&end_time, NULL);
135 next=op_http_parse_status_line(&v1_1_compat,&status_code, 135 next=op_http_parse_status_line(&v1_1_compat,&status_code,
136 _stream->response.buf); 136 _stream->response.buf);
137 if(OP_UNLIKELY(next==NULL))return OP_FALSE; 137 if(OP_UNLIKELY(next==NULL))return OP_FALSE;
138@@ -2733,8 +2736,8 @@ static int op_http_conn_handle_response( 138@@ -2852,8 +2855,8 @@ static int op_http_conn_handle_response(
139 converted into a request for the rest.*/ 139 converted into a request for the rest.*/
140 static int op_http_conn_open_pos(OpusHTTPStream *_stream, 140 static int op_http_conn_open_pos(OpusHTTPStream *_stream,
141 OpusHTTPConn *_conn,opus_int64 _pos,opus_int32 _chunk_size){ 141 OpusHTTPConn *_conn,opus_int64 _pos,opus_int32 _chunk_size){
142- struct timeb start_time; 142- struct timeb start_time;
143- struct timeb end_time; 143- struct timeb end_time;
144+ struct timeval start_time; 144+ struct timeval start_time;
145+ struct timeval end_time; 145+ struct timeval end_time;
146 opus_int32 connect_rate; 146 opus_int32 connect_rate;
147 opus_int32 connect_time; 147 opus_int32 connect_time;
148 int ret; 148 int ret;
149@@ -2744,7 +2747,7 @@ static int op_http_conn_open_pos(OpusHTT 149@@ -2863,7 +2866,7 @@ static int op_http_conn_open_pos(OpusHTT
150 if(OP_UNLIKELY(ret<0))return ret; 150 if(OP_UNLIKELY(ret<0))return ret;
151 ret=op_http_conn_handle_response(_stream,_conn); 151 ret=op_http_conn_handle_response(_stream,_conn);
152 if(OP_UNLIKELY(ret!=0))return OP_FALSE; 152 if(OP_UNLIKELY(ret!=0))return OP_FALSE;
153- ftime(&end_time); 153- ftime(&end_time);
154+ gettimeofday(&end_time, NULL); 154+ gettimeofday(&end_time, NULL);
155 _stream->cur_conni=_conn-_stream->conns; 155 _stream->cur_conni=(int)(_conn-_stream->conns);
156 OP_ASSERT(_stream->cur_conni>=0&&_stream->cur_conni<OP_NCONNS_MAX); 156 OP_ASSERT(_stream->cur_conni>=0&&_stream->cur_conni<OP_NCONNS_MAX);
157 /*The connection has been successfully opened. 157 /*The connection has been successfully opened.
158@@ -2996,7 +2999,7 @@ static int op_http_conn_read_ahead(OpusH 158@@ -3115,7 +3118,7 @@ static int op_http_conn_read_ahead(OpusH
159 } 159 }
160  160
161 static int op_http_stream_seek(void *_stream,opus_int64 _offset,int _whence){ 161 static int op_http_stream_seek(void *_stream,opus_int64 _offset,int _whence){
162- struct timeb seek_time; 162- struct timeb seek_time;
163+ struct timeval seek_time; 163+ struct timeval seek_time;
164 OpusHTTPStream *stream; 164 OpusHTTPStream *stream;
165 OpusHTTPConn *conn; 165 OpusHTTPConn *conn;
166 OpusHTTPConn **pnext; 166 OpusHTTPConn **pnext;
167@@ -3037,7 +3040,7 @@ static int op_http_stream_seek(void *_st 167@@ -3156,7 +3159,7 @@ static int op_http_stream_seek(void *_st
168 op_http_conn_read_rate_update(stream->conns+ci); 168 op_http_conn_read_rate_update(stream->conns+ci);
169 *&seek_time=*&stream->conns[ci].read_time; 169 *&seek_time=*&stream->conns[ci].read_time;
170 } 170 }
171- else ftime(&seek_time); 171- else ftime(&seek_time);
172+ else gettimeofday(&seek_time, NULL); 172+ else gettimeofday(&seek_time, NULL);
173 /*If we seeked past the end of the stream, just disable the active 173 /*If we seeked past the end of the stream, just disable the active
174 connection.*/ 174 connection.*/
175 if(pos>=content_length){ 175 if(pos>=content_length){