From 73a6ea599debbc0221a43ffdb0c054c0d6aec5ea Mon Sep 17 00:00:00 2001 From: "SmallChi(Koike)" <564952747@qq.com> Date: Sat, 31 Jul 2021 11:36:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E5=8F=91=E9=80=81?= =?UTF-8?q?=E9=A2=91=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/JT1078.FMp4.Test/JT1078.FMp4.Test.csproj | 3 +++ src/JT1078.FMp4/JT1078.FMp4.csproj | 2 +- src/JT1078.Hls.Test/M3U8_Test.cs | 15 +++++++++++---- .../Services/ToWebSocketService.cs | 5 +++-- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/JT1078.FMp4.Test/JT1078.FMp4.Test.csproj b/src/JT1078.FMp4.Test/JT1078.FMp4.Test.csproj index cb53f71..0068040 100644 --- a/src/JT1078.FMp4.Test/JT1078.FMp4.Test.csproj +++ b/src/JT1078.FMp4.Test/JT1078.FMp4.Test.csproj @@ -58,6 +58,9 @@ Always + + Always + diff --git a/src/JT1078.FMp4/JT1078.FMp4.csproj b/src/JT1078.FMp4/JT1078.FMp4.csproj index f5ddf5f..9f66ea3 100644 --- a/src/JT1078.FMp4/JT1078.FMp4.csproj +++ b/src/JT1078.FMp4/JT1078.FMp4.csproj @@ -14,7 +14,7 @@ https://github.com/SmallChi/JT1078/blob/master/LICENSE https://github.com/SmallChi/JT1078/blob/master/LICENSE true - 1.0.0-preview3 + 1.0.0-preview4 false true LICENSE diff --git a/src/JT1078.Hls.Test/M3U8_Test.cs b/src/JT1078.Hls.Test/M3U8_Test.cs index 40125fe..6f8a266 100644 --- a/src/JT1078.Hls.Test/M3U8_Test.cs +++ b/src/JT1078.Hls.Test/M3U8_Test.cs @@ -22,7 +22,7 @@ namespace JT1078.Hls.Test { var lines = File.ReadAllLines(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "H264", "jt1078_5.txt")); Socket clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); - clientSocket.Connect("127.0.0.1",1078); + clientSocket.Connect("127.0.0.1", 10888); long lasttime = 0; foreach (var line in lines) { @@ -31,10 +31,17 @@ namespace JT1078.Hls.Test { lasttime = long.Parse(temp[0]); } - else { + else + { var ts = long.Parse(temp[0]) - lasttime; - if (ts > 3) ts = 3; - Thread.Sleep(TimeSpan.FromSeconds(ts)); + if(ts>0) + { + Thread.Sleep(TimeSpan.FromMilliseconds(ts)); + } + else if (ts == 0) + { + + } lasttime = long.Parse(temp[0]); } var data= temp[1].ToHexBytes(); diff --git a/src/JT1078.SignalR.Test/Services/ToWebSocketService.cs b/src/JT1078.SignalR.Test/Services/ToWebSocketService.cs index 78b1704..f2e0b39 100644 --- a/src/JT1078.SignalR.Test/Services/ToWebSocketService.cs +++ b/src/JT1078.SignalR.Test/Services/ToWebSocketService.cs @@ -126,12 +126,13 @@ namespace JT1078.SignalR.Test.Services if (flag.ContainsKey(session)) { var len = flag[session]; - if (q.Count < len) + if (q.Count <= len) { break; } await _hubContext.Clients.Client(session).SendAsync("video", q[len], stoppingToken); - flag[session] = ++len; + len++; + flag[session] = len; } else {