From 6437e0f89a50c4c8709ff5d65eb3c0a47e7bb7d6 Mon Sep 17 00:00:00 2001 From: cloudwebrtc Date: Mon, 8 Apr 2024 08:31:56 +0800 Subject: [PATCH] update. --- api/crypto/frame_crypto_transformer.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/api/crypto/frame_crypto_transformer.cc b/api/crypto/frame_crypto_transformer.cc index 9ec8452077..06ec888170 100644 --- a/api/crypto/frame_crypto_transformer.cc +++ b/api/crypto/frame_crypto_transformer.cc @@ -386,9 +386,10 @@ void FrameCryptorTransformer::encryptFrame( if (date_in.size() == 0 || !enabled_cryption) { RTC_LOG(LS_WARNING) << "FrameCryptorTransformer::encryptFrame() " "date_in.size() == 0 || enabled_cryption == false"; - if(!key_provider_->options().discard_frame_when_cryptor_not_ready) { - sink_callback->OnTransformedFrame(std::move(frame)); + if(key_provider_->options().discard_frame_when_cryptor_not_ready) { + return; } + sink_callback->OnTransformedFrame(std::move(frame)); return; } @@ -496,9 +497,11 @@ void FrameCryptorTransformer::decryptFrame( if (date_in.size() == 0 || !enabled_cryption) { RTC_LOG(LS_WARNING) << "FrameCryptorTransformer::decryptFrame() " "date_in.size() == 0 || enabled_cryption == false"; - if(!key_provider_->options().discard_frame_when_cryptor_not_ready) { - sink_callback->OnTransformedFrame(std::move(frame)); + if(key_provider_->options().discard_frame_when_cryptor_not_ready) { + return; } + + sink_callback->OnTransformedFrame(std::move(frame)); return; }