debug: add some log

This commit is contained in:
langhuihui
2023-10-30 10:11:48 +08:00
parent 8ffe3d3d55
commit 4a9dd2c921
4 changed files with 44 additions and 38 deletions

View File

@@ -1,7 +1,6 @@
package engine
import (
"context"
"io"
"strings"
"time"
@@ -86,13 +85,7 @@ func (pub *Puller) startPull(puller IPuller) {
puller.Error("pull publish", zap.Error(err))
return
}
s := puber.Stream
if stream != s && stream != nil { // 这段代码说明老流已经中断创建了新流需要把track置空从而避免复用
puber.AudioTrack = nil
puber.VideoTrack = nil
puber.Context, puber.CancelFunc = context.WithCancel(Engine) // 老流的上下文已经取消,需要重新创建
}
stream = s
stream = puber.Stream
badPuller = false
if err = puller.Pull(); err != nil && !puller.IsShutdown() {
puller.Error("pull interrupt", zap.Error(err))