fix: 国标级联转发失败问题

This commit is contained in:
yangjiechina
2025-05-11 18:58:33 +08:00
parent b254fff76c
commit 61e152e8ed
2 changed files with 6 additions and 2 deletions

View File

@@ -102,6 +102,8 @@ func (api *ApiServer) OnGBSourceCreate(v *SourceSDP, w http.ResponseWriter, r *h
response.Addr = net.JoinHostPort(stream.AppConfig.PublicIP, strconv.Itoa(port))
response.Urls = stream.GetStreamPlayUrls(v.Source)
response.SSRC = ssrc
log.Sugar.Infof("创建国标源成功, addr: %s, ssrc: %d", response.Addr, ssrcValue)
httpResponseOK(w, response)
}

View File

@@ -472,7 +472,7 @@ func (s *PublishSource) doAddSink(sink Sink, resume bool) bool {
}
// 新建传输流,发送已经缓存的音视频帧
if !exist && AppConfig.GOPCache && s.existVideo {
if !exist && AppConfig.GOPCache && s.existVideo && TransStreamGBCascadedForward != transStream.GetProtocol() {
s.DispatchGOPBuffer(transStream)
}
@@ -828,7 +828,9 @@ func (s *PublishSource) OnPacket(packet *avformat.AVPacket) {
// 分发给各个传输流
for _, transStream := range s.TransStreams {
s.DispatchPacket(transStream, packet)
if TransStreamGBCascadedForward != transStream.GetProtocol() {
s.DispatchPacket(transStream, packet)
}
}
}