You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let sample_rate = u64::from(AudioRenderer::SAMPLE_RATE);
447
-
let fps_u64 = u64::from(fps);
448
-
letmut audio_sample_cursor = 0u64;
449
-
450
-
letmut consecutive_timeouts = 0u32;
451
-
constMAX_CONSECUTIVE_TIMEOUTS:u32 = 3;
452
-
453
-
loop{
454
-
let timeout_secs = if frame_count == 0{120}else{90};
455
-
let(frame, frame_number) = match tokio::time::timeout(
456
-
Duration::from_secs(timeout_secs),
457
-
video_rx.recv(),
458
-
)
459
-
.await
460
-
{
461
-
Err(_) => {
462
-
consecutive_timeouts += 1;
463
-
464
-
if consecutive_timeouts >= MAX_CONSECUTIVE_TIMEOUTS{
465
-
tracing::error!(
466
-
frame_count = frame_count,
467
-
timeout_secs = timeout_secs,
468
-
consecutive_timeouts = consecutive_timeouts,
469
-
"Export render_task timed out {} consecutive times - aborting",
470
-
MAX_CONSECUTIVE_TIMEOUTS
471
-
);
472
-
returnErr(format!(
473
-
"Export timed out {MAX_CONSECUTIVE_TIMEOUTS} times consecutively after {timeout_secs}s each waiting for frame {frame_count} - GPU/decoder may be unresponsive"
474
-
));
475
-
}
476
-
477
-
tracing::warn!(
478
-
frame_count = frame_count,
479
-
timeout_secs = timeout_secs,
480
-
consecutive_timeouts = consecutive_timeouts,
481
-
"Frame receive timed out, waiting for next frame..."
482
-
);
483
-
continue;
484
-
}
485
-
Ok(Some(v)) => {
486
-
consecutive_timeouts = 0;
487
-
v
488
-
}
489
-
Ok(None) => {
490
-
tracing::debug!(
491
-
frame_count = frame_count,
492
-
"Render channel closed - rendering complete"
493
-
);
494
-
break;
495
-
}
496
-
};
497
-
498
-
if !(on_progress)(frame_count){
499
-
returnErr("Export cancelled".to_string());
500
-
}
501
-
502
-
if frame_count == 0{
503
-
first_frame = Some(frame.clone());
504
-
ifletSome(audio) = &mut audio_renderer {
505
-
audio.set_playhead(0.0,&project);
506
-
}
507
-
}
508
-
509
-
let audio_frame = audio_renderer.as_mut().and_then(|audio| {
0 commit comments