Second fix for Chinese buggy cameras
This commit is contained in:
+3
-5
@@ -75,11 +75,8 @@ func RTPDepay(track *streamer.Track) streamer.WrapperFunc {
|
||||
// https://github.com/AlexxIT/WebRTC/issues/391
|
||||
// https://github.com/AlexxIT/WebRTC/issues/392
|
||||
for i := 0; i < len(payload); {
|
||||
switch NALUType(payload[i:]) {
|
||||
case NALUTypeSPS, NALUTypePPS, NALUTypeIFrame, NALUTypePFrame:
|
||||
default:
|
||||
payload = payload[:i]
|
||||
continue
|
||||
if i+4 >= len(payload) {
|
||||
break
|
||||
}
|
||||
|
||||
size := bytes.Index(payload[i+4:], []byte{0, 0, 0, 1})
|
||||
@@ -89,6 +86,7 @@ func RTPDepay(track *streamer.Track) streamer.WrapperFunc {
|
||||
}
|
||||
size = len(payload) - (i + 4)
|
||||
}
|
||||
|
||||
binary.BigEndian.PutUint32(payload[i:], uint32(size))
|
||||
|
||||
i += size + 4
|
||||
|
||||
+2
-2
@@ -395,11 +395,11 @@ export class VideoRTC extends HTMLElement {
|
||||
bufLen = 0;
|
||||
sb.appendBuffer(data);
|
||||
} else if (sb.buffered && sb.buffered.length) {
|
||||
const end = sb.buffered.end(sb.buffered.length - 1) - 5;
|
||||
const end = sb.buffered.end(sb.buffered.length - 1) - 15;
|
||||
const start = sb.buffered.start(0);
|
||||
if (end > start) {
|
||||
sb.remove(start, end);
|
||||
ms.setLiveSeekableRange(end, end + 5);
|
||||
ms.setLiveSeekableRange(end, end + 15);
|
||||
}
|
||||
// console.debug("VideoRTC.buffered", start, end);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user