Skip to content

Conversation

@xianshijing-lk
Copy link
Contributor

Two changes on the C++ code:

  1. one is to use std::vector rather than raw pointer for silence_audio_;
  2. when injecting silence to sinks after missing 10 frames, current code will keep injecting and not reset the counter; instead, we should reset the counter once we get real audio, this will prevent breaking the audio.

Suppressing some compilation warnings:
66 | fn utf8_aware_chunks(&self, chunk_size: usize) -> Utf8AwareChunks {
| ^^^^^ --------------- the same lifetime is hidden here
| |
| the lifetime is elided here
|
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use '_ for type paths
|
66 | fn utf8_aware_chunks(&self, chunk_size: usize) -> Utf8AwareChunks<'_> {
| ++++

warning: hiding a lifetime that's elided elsewhere is confusing

and one webrtc related nullable warning

@CLAassistant
Copy link

CLAassistant commented Oct 10, 2025

CLA assistant check
All committers have signed the CLA.

@ladvoc
Copy link
Contributor

ladvoc commented Oct 10, 2025

@xianshijing-lk, please merge from main—this will fix CI build.

@xianshijing-lk xianshijing-lk force-pushed the sxian/improve_memory_safe_in_webrtc_code branch from 4fa6000 to 8b41535 Compare October 10, 2025 23:37
Copy link
Contributor

@cloudwebrtc cloudwebrtc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@xianshijing-lk
Copy link
Contributor Author

@xianshijing-lk, please merge from main—this will fix CI build.

I rebased, but the CI still fails. The logs show that it does not have protoc, any idea what could the problem ?

Protobuf generation failed: Custom { kind: NotFound, error: "Could not find protoc. If protoc is installed, try setting the PROTOC environment variable to the path of the protoc binary. To install it on macOS, run brew install protobuf. It is also available at https://github.com/protocolbuffers/protobuf/releases For more information: https://docs.rs/prost-build/#sourcing-protoc" }

@xianshijing-lk xianshijing-lk force-pushed the sxian/improve_memory_safe_in_webrtc_code branch from 8b41535 to bfc10e2 Compare October 11, 2025 05:10
@xianshijing-lk xianshijing-lk merged commit 220b555 into main Oct 11, 2025
18 of 19 checks passed
@xianshijing-lk xianshijing-lk deleted the sxian/improve_memory_safe_in_webrtc_code branch October 11, 2025 16:21
@github-actions github-actions bot mentioned this pull request Oct 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants