diff --git a/io.go b/io.go index 4259318..33527fc 100644 --- a/io.go +++ b/io.go @@ -229,6 +229,9 @@ func (io *IO) receive(streamPath string, specific common.IIO) error { if !isSubscribe { puber := iPub.GetPublisher() conf := puber.Config + if io.Args.Get("bufferTime") != "" { + conf.BufferTime, _ = time.ParseDuration(io.Args.Get("bufferTime")) + } io.Info("publish", zap.String("ptr", fmt.Sprintf("%p", iPub))) s.pubLocker.Lock() defer s.pubLocker.Unlock() diff --git a/track/reader-av.go b/track/reader-av.go index 2061971..f05f0a7 100644 --- a/track/reader-av.go +++ b/track/reader-av.go @@ -131,7 +131,7 @@ func (r *AVRingReader) ReadFrame(mode int) (err error) { if err = r.readFrame(); err != nil { return } - if mode != SUBMODE_REAL { + if mode == SUBMODE_NOJUMP { if fast := r.Value.Timestamp - r.FirstTs - time.Since(r.startTime); fast > 0 && fast < time.Second { time.Sleep(fast) }