Fix connection status error: send packets only when ice status is ready

This commit is contained in:
dijunkun
2023-12-05 15:12:18 +08:00
parent 936348ba9e
commit 6a6e922fc1
2 changed files with 7 additions and 5 deletions

View File

@@ -222,6 +222,9 @@ int OpenH264Encoder::Encode(
if (on_encoded_image) {
on_encoded_image((char *)encoded_frame_, encoded_frame_size_);
if (SAVE_H264_STREAM) {
fwrite(encoded_frame_, 1, encoded_frame_size_, file_h264_);
}
} else {
OnEncodedImage((char *)encoded_frame_, encoded_frame_size_);
}