From 7155b866c2a445ec71e253c462029fdd77b30e06 Mon Sep 17 00:00:00 2001 From: ydajiang Date: Thu, 12 Jun 2025 10:30:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=8D=E6=94=AF=E6=8C=81=E7=9A=84?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E5=99=A8=E4=BB=8D=E7=84=B6=E7=BB=A7=E7=BB=AD?= =?UTF-8?q?=E5=B0=81=E8=A3=85=E6=B5=81=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stream/stream_publisher.go | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/stream/stream_publisher.go b/stream/stream_publisher.go index 91e4fb8..584cc43 100644 --- a/stream/stream_publisher.go +++ b/stream/stream_publisher.go @@ -201,14 +201,6 @@ func (t *transStreamPublisher) CreateDefaultOutStreams() { } } -func IsSupportMux(protocol TransStreamProtocol, _, _ utils.AVCodecID) bool { - if TransStreamRtmp == protocol || TransStreamFlv == protocol { - - } - - return true -} - func (t *transStreamPublisher) CreateTransStream(id TransStreamID, protocol TransStreamProtocol, tracks []*Track, sink Sink) (TransStream, error) { log.Sugar.Infof("创建%s-stream source: %s", protocol.String(), t.source) @@ -227,7 +219,8 @@ func (t *transStreamPublisher) CreateTransStream(id TransStreamID, protocol Tran _, ok = supportedCodecs[track.Stream.CodecID] if !ok { - log.Sugar.Warnf("不支持的编码器 %s %s", protocol.String(), track.Stream.CodecID) + log.Sugar.Warnf("不支持的编码器 source: %s stream: %s codec: %s", t.source, protocol.String(), track.Stream.CodecID) + continue } var index int @@ -258,7 +251,7 @@ func (t *transStreamPublisher) CreateTransStream(id TransStreamID, protocol Tran t.forwardTransStream = transStream } - return transStream, err + return transStream, nil } func (t *transStreamPublisher) DispatchGOPBuffer(transStream TransStream) { @@ -346,7 +339,7 @@ func (t *transStreamPublisher) doAddSink(sink Sink, resume bool) bool { } // 不支持对期望编码的流封装. 降级 - if (utils.AVCodecIdNONE != audioCodecId || utils.AVCodecIdNONE != videoCodecId) && !IsSupportMux(sink.GetProtocol(), audioCodecId, videoCodecId) { + if utils.AVCodecIdNONE != audioCodecId || utils.AVCodecIdNONE != videoCodecId { audioCodecId = utils.AVCodecIdNONE videoCodecId = utils.AVCodecIdNONE }