From ac4899a5f43eb4311ccae1405040bda3870470b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=97=E5=A8=81?= Date: Tue, 26 Aug 2025 22:39:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9SetDataSource=E6=97=B6?= =?UTF-8?q?=EF=BC=8CsinkFilter=E5=92=8CdecoderFilter=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E4=B8=8D=E5=90=8C=E8=BD=A8=E9=81=93=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 孙志威 --- services/media_engine/filters/demuxer_filter.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/media_engine/filters/demuxer_filter.cpp b/services/media_engine/filters/demuxer_filter.cpp index 82537fc72..d90f575fc 100644 --- a/services/media_engine/filters/demuxer_filter.cpp +++ b/services/media_engine/filters/demuxer_filter.cpp @@ -262,6 +262,7 @@ Status DemuxerFilter::HandleTrackInfos(const std::vector> bool hasVideoFilter = false; bool hasInvalidVideo = false; bool hasInvalidAudio = false; + bool hasAudioTrack = false; FALSE_RETURN_V_MSG(callback_ != nullptr, Status::OK, "callback is nullptr"); for (size_t index = 0; index < trackInfos.size(); index++) { std::shared_ptr meta = trackInfos[index]; @@ -288,9 +289,13 @@ Status DemuxerFilter::HandleTrackInfos(const std::vector> UpdateTrackIdMap(streamType, static_cast(index)); FALSE_CONTINUE_NOLOG(streamType != StreamType::STREAMTYPE_ENCODED_VIDEO || !hasVideoFilter); hasVideoFilter |= (streamType == StreamType::STREAMTYPE_ENCODED_VIDEO && isEnableReselectVideoTrack_); + FALSE_CONTINUE_NOLOG(mediaType != Plugins::MediaType::AUDIO || !hasAudioTrack); ret = callback_->OnCallback(shared_from_this(), FilterCallBackCommand::NEXT_FILTER_NEEDED, streamType); FALSE_RETURN_V_MSG_E(ret == Status::OK || FaultDemuxerEventInfoWrite(streamType) != Status::OK, ret, "OnCallback Link Filter Fail."); + if (mediaType == Plugins::MediaType::AUDIO) { + hasVideoFilter = true; + } successNodeCount++; } bool isOnlyInvalidAVTrack = (hasInvalidVideo && !demuxer_->HasVideo()) -- Gitee From de81822888f0d61561d18cd9d03b0de10cac2f6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=97=E5=A8=81?= Date: Wed, 27 Aug 2025 11:46:00 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E6=84=8F=E8=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 孙志威 --- services/media_engine/filters/demuxer_filter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/media_engine/filters/demuxer_filter.cpp b/services/media_engine/filters/demuxer_filter.cpp index d90f575fc..da7ec476b 100644 --- a/services/media_engine/filters/demuxer_filter.cpp +++ b/services/media_engine/filters/demuxer_filter.cpp @@ -294,7 +294,7 @@ Status DemuxerFilter::HandleTrackInfos(const std::vector> FALSE_RETURN_V_MSG_E(ret == Status::OK || FaultDemuxerEventInfoWrite(streamType) != Status::OK, ret, "OnCallback Link Filter Fail."); if (mediaType == Plugins::MediaType::AUDIO) { - hasVideoFilter = true; + hasAudioTrack = true; } successNodeCount++; } -- Gitee