File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
packages/webrtc/src/media Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -283,15 +283,24 @@ export class RTCRtpSender {
283283 } catch ( error ) { }
284284 }
285285
286- replaceRTP ( {
287- sequenceNumber,
288- timestamp,
289- } : Pick < RtpHeader , "sequenceNumber" | "timestamp" > ) {
286+ replaceRTP (
287+ {
288+ sequenceNumber,
289+ timestamp,
290+ } : Pick < RtpHeader , "sequenceNumber" | "timestamp" > ,
291+ discontinuity = false
292+ ) {
290293 if ( this . sequenceNumber != undefined ) {
291294 this . seqOffset = uint16Add ( this . sequenceNumber , - sequenceNumber ) ;
295+ if ( discontinuity ) {
296+ this . seqOffset = uint16Add ( this . seqOffset , 2 ) ;
297+ }
292298 }
293299 if ( this . timestamp != undefined ) {
294300 this . timestampOffset = uint32Add ( this . timestamp , - timestamp ) ;
301+ if ( discontinuity ) {
302+ this . timestampOffset = uint16Add ( this . timestampOffset , 1 ) ;
303+ }
295304 }
296305 this . rtpCache = [ ] ;
297306 log ( "replaceRTP" , this . sequenceNumber , sequenceNumber , this . seqOffset ) ;
You can’t perform that action at this time.
0 commit comments