remove first frame fallback if repeat (#9267)

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages 2024-09-05 22:48:20 +08:00 committed by GitHub
parent 7a1157f1b0
commit 4150036589
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -947,7 +947,9 @@ fn handle_one_frame(
} else {
3
};
if first || *encode_fail_counter >= max_fail_times {
let repeat = !encoder.latency_free();
// repeat encoders can reach max_fail_times on the first frame
if (first && !repeat) || *encode_fail_counter >= max_fail_times {
*encode_fail_counter = 0;
if encoder.is_hardware() {
encoder.disable();