From 02fb0779be390d208a91568db74d02f14921e1c2 Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 10 Aug 2016 22:13:24 +0800 Subject: [PATCH] fix the microsec calc bug for librtmp --- trunk/src/libs/srs_lib_simple_socket.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trunk/src/libs/srs_lib_simple_socket.cpp b/trunk/src/libs/srs_lib_simple_socket.cpp index a45c1d4d2..79d2bcf38 100644 --- a/trunk/src/libs/srs_lib_simple_socket.cpp +++ b/trunk/src/libs/srs_lib_simple_socket.cpp @@ -164,8 +164,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { SrsBlockSyncSocket* skt = (SrsBlockSyncSocket*)ctx; - int sec = timeout_us / (1000 * 1000LL); - int microsec = timeout_us / 1000LL % 1000; + int sec = (int)(timeout_us / 1000000LL); + int microsec = (int)(timeout_us % 1000000LL); sec = srs_max(0, sec); microsec = srs_max(0, microsec); @@ -192,8 +192,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { SrsBlockSyncSocket* skt = (SrsBlockSyncSocket*)ctx; - int sec = timeout_us / (1000 * 1000LL); - int microsec = timeout_us / 1000LL % 1000; + int sec = (int)(timeout_us / 1000000LL); + int microsec = (int)(timeout_us % 1000000LL); sec = srs_max(0, sec); microsec = srs_max(0, microsec);