yonge 11 months ago
parent
commit
ebf054fb8d

+ 2 - 2
audio-analysis/src/main/java/com/yonge/netty/dto/UserChannelContext.java

@@ -732,7 +732,7 @@ public class UserChannelContext {
 
 		ChunkAnalysis firstChunkAnalysis = chunkAnalysisList.get(0);
 		
-		Optional<ChunkAnalysis> chunkAnalysisOptional = totalChunkAnalysisList.stream().filter(t -> Double.doubleToLongBits(t.getEndTime()) < Double.doubleToLongBits(firstChunkAnalysis.getStartTime())).reduce((first, second) -> second);
+		Optional<ChunkAnalysis> chunkAnalysisOptional = totalChunkAnalysisList.stream().filter(t -> Double.doubleToLongBits(t.getEndTime()) <= Double.doubleToLongBits(firstChunkAnalysis.getStartTime())).reduce((first, second) -> second);
 
 		ChunkAnalysis lastChunkAnalysis = null;
 		if (chunkAnalysisOptional.isPresent()) {
@@ -892,7 +892,7 @@ public class UserChannelContext {
 			return chunkList.stream().filter(t -> t.getAmplitude() > hardLevel.getAmplitudeThreshold()).count() <= 0;
 		}
 		
-		Optional<ChunkAnalysis> chunkAnalysisOptional = totalChunkAnalysisList.stream().filter(t -> Double.doubleToLongBits(t.getEndTime()) < Double.doubleToLongBits(firstChunkAnalysis.getStartTime())).reduce((first, second) -> second);
+		Optional<ChunkAnalysis> chunkAnalysisOptional = totalChunkAnalysisList.stream().filter(t -> Double.doubleToLongBits(t.getEndTime()) <= Double.doubleToLongBits(firstChunkAnalysis.getStartTime())).reduce((first, second) -> second);
 
 		ChunkAnalysis lastChunkAnalysis = new ChunkAnalysis(0, 0, -1, 0, 0, 0);;
 		if (chunkAnalysisOptional.isPresent()) {