fix: submode=2 don't limit speed

This commit is contained in:
langhuihui
2024-07-26 11:11:18 +08:00
parent 56130d5339
commit 172ebf3ad1
2 changed files with 4 additions and 1 deletions

3
io.go
View File

@@ -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()

View File

@@ -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)
}