Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pkg/ipeye/ipeye.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (p *Producer) Start() error {
}
}

// RTP счётчики
// RTP counters
rtpStart := rand.Uint32()
seq := uint16(rand.Uint32())
var dts uint64
Expand Down Expand Up @@ -169,10 +169,10 @@ func (p *Producer) Start() error {
continue
}

// RTP TS для этого sample
// RTP TS for this sample
ts := rtpStart + uint32((dts*uint64(p.clockRate)/90000)%wrapPeriod)

// Отправляем один RTP-пакет с полезной нагрузкой в AVCC
// Send one RTP packet with payload in AVCC
seq++
recv.Input(&rtp.Packet{
Header: rtp.Header{
Expand All @@ -185,7 +185,7 @@ func (p *Producer) Start() error {
Payload: mdatData,
})

// выбираем длительность
// Choose duration
dur := defaultDur
if len(samplesDur) > 0 && samplesDur[0] != 0 {
dur = samplesDur[0]
Expand All @@ -194,7 +194,7 @@ func (p *Producer) Start() error {
dur = p.clockRate / 25 // fallback
}

// инкремент DTS
// Increment DTS
dts += uint64(dur)
if dts >= wrapPeriod {
dts %= wrapPeriod
Expand Down