mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-25 04:22:00 -08:00
sourcertmp: fix frame dropping
This commit is contained in:
parent
aab9eaa2c7
commit
e5daab6357
1 changed files with 2 additions and 3 deletions
|
|
@ -256,7 +256,6 @@ func (s *sourceRtmp) runInnerInner() bool {
|
|||
|
||||
readDone := make(chan error)
|
||||
go func() {
|
||||
|
||||
for {
|
||||
pkt, err := conn.ReadPacket()
|
||||
if err != nil {
|
||||
|
|
@ -279,7 +278,7 @@ func (s *sourceRtmp) runInnerInner() bool {
|
|||
}
|
||||
|
||||
// encode into RTP/H264 format
|
||||
frames, err := h264Encoder.Write(nalus, pkt.Time)
|
||||
frames, err := h264Encoder.Write(nalus, pkt.Time+pkt.CTime)
|
||||
if err != nil {
|
||||
readDone <- err
|
||||
return
|
||||
|
|
@ -295,7 +294,7 @@ func (s *sourceRtmp) runInnerInner() bool {
|
|||
return
|
||||
}
|
||||
|
||||
frames, err := aacEncoder.Write(pkt.Data, pkt.Time)
|
||||
frames, err := aacEncoder.Write(pkt.Data, pkt.Time+pkt.CTime)
|
||||
if err != nil {
|
||||
readDone <- err
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue