From 61e152e8edb9f55e97fa9716c6681ee9fe6d9a87 Mon Sep 17 00:00:00 2001 From: yangjiechina <1534796060@qq.com> Date: Sun, 11 May 2025 18:58:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9B=BD=E6=A0=87=E7=BA=A7=E8=81=94?= =?UTF-8?q?=E8=BD=AC=E5=8F=91=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api_gb.go | 2 ++ stream/source.go | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/api_gb.go b/api_gb.go index e3c145a..c7bb489 100644 --- a/api_gb.go +++ b/api_gb.go @@ -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) } diff --git a/stream/source.go b/stream/source.go index 5ad3b91..02de79e 100644 --- a/stream/source.go +++ b/stream/source.go @@ -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) + } } }