mirror of
https://github.com/Monibuca/engine.git
synced 2025-10-06 00:56:58 +08:00
修复data track订阅问题
This commit is contained in:
@@ -220,7 +220,7 @@ var ErrStreamNotExist = errors.New("stream not exist")
|
|||||||
|
|
||||||
// SubscribeExist 订阅已经存在的流
|
// SubscribeExist 订阅已经存在的流
|
||||||
func (opt *Plugin) SubscribeExist(streamPath string, sub ISubscriber) error {
|
func (opt *Plugin) SubscribeExist(streamPath string, sub ISubscriber) error {
|
||||||
opt.Info("subscribe exit", zap.String("path", streamPath))
|
opt.Info("subscribe exsit", zap.String("path", streamPath))
|
||||||
path, _, _ := strings.Cut(streamPath, "?")
|
path, _, _ := strings.Cut(streamPath, "?")
|
||||||
if !Streams.Has(path) {
|
if !Streams.Has(path) {
|
||||||
opt.Warn("stream not exist", zap.String("path", streamPath))
|
opt.Warn("stream not exist", zap.String("path", streamPath))
|
||||||
|
@@ -169,6 +169,7 @@ func (s *Subscriber) PlayBlock(subType byte) {
|
|||||||
ctx := s.TrackPlayer.Context
|
ctx := s.TrackPlayer.Context
|
||||||
conf := s.Config
|
conf := s.Config
|
||||||
hasVideo, hasAudio := s.Video != nil && conf.SubVideo, s.Audio != nil && conf.SubAudio
|
hasVideo, hasAudio := s.Video != nil && conf.SubVideo, s.Audio != nil && conf.SubAudio
|
||||||
|
defer s.onStop()
|
||||||
if !hasAudio && !hasVideo {
|
if !hasAudio && !hasVideo {
|
||||||
s.Error("play neither video nor audio")
|
s.Error("play neither video nor audio")
|
||||||
return
|
return
|
||||||
@@ -260,7 +261,7 @@ func (s *Subscriber) PlayBlock(subType byte) {
|
|||||||
sendFlvFrame(codec.FLV_TAG_TYPE_AUDIO, s.AudioReader.AbsTime, frame.AVCC.ToBuffers()...)
|
sendFlvFrame(codec.FLV_TAG_TYPE_AUDIO, s.AudioReader.AbsTime, frame.AVCC.ToBuffers()...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
defer s.onStop()
|
|
||||||
var subMode = conf.SubMode //订阅模式
|
var subMode = conf.SubMode //订阅模式
|
||||||
if s.Args.Has(conf.SubModeArgName) {
|
if s.Args.Has(conf.SubModeArgName) {
|
||||||
subMode, _ = strconv.Atoi(s.Args.Get(conf.SubModeArgName))
|
subMode, _ = strconv.Atoi(s.Args.Get(conf.SubModeArgName))
|
||||||
|
@@ -76,9 +76,8 @@ func (w *waitTracks) Accept(t Track) bool {
|
|||||||
suber.OnEvent(t)
|
suber.OnEvent(t)
|
||||||
}
|
}
|
||||||
case *track.Data:
|
case *track.Data:
|
||||||
if w.data.Accept(t.GetBase().Name) {
|
w.data.Accept(t.GetBase().Name)
|
||||||
suber.OnEvent(t)
|
suber.OnEvent(t)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if w.NeedWait() {
|
if w.NeedWait() {
|
||||||
return false
|
return false
|
||||||
|
Reference in New Issue
Block a user