优化代码适配RC1

This commit is contained in:
langhuihui
2022-02-19 21:15:10 +08:00
parent c0bd09e249
commit 24ed1b337c
16 changed files with 298 additions and 194 deletions

View File

@@ -11,7 +11,6 @@ import (
"github.com/Monibuca/engine/v4/config"
"github.com/Monibuca/engine/v4/log"
"github.com/Monibuca/engine/v4/track"
"github.com/Monibuca/engine/v4/util"
"go.uber.org/zap"
"gopkg.in/yaml.v3"
@@ -189,12 +188,8 @@ func (opt *Plugin) Publish(streamPath string, pub IPublisher) bool {
}
if ok = pub.receive(streamPath, pub, conf.GetPublishConfig()); ok {
p := pub.GetPublisher()
unA := track.UnknowAudio{}
unA.Stream = p.Stream
p.AudioTrack = &unA
unV := track.UnknowVideo{}
unV.Stream = p.Stream
p.VideoTrack = &unV
p.AudioTrack = p.Stream.NewAudioTrack()
p.VideoTrack = p.Stream.NewVideoTrack()
}
return ok
}
@@ -204,9 +199,5 @@ func (opt *Plugin) Subscribe(streamPath string, sub ISubscriber) bool {
if !ok {
conf = EngineConfig
}
if ok = sub.receive(streamPath, sub, conf.GetSubscribeConfig()); ok {
p := sub.GetSubscriber()
p.TrackPlayer.Context, p.TrackPlayer.CancelFunc = context.WithCancel(p.IO)
}
return ok
return sub.receive(streamPath, sub, conf.GetSubscribeConfig())
}