Skip to content

Commit

Permalink
Fix offline processing (+ send DELIVERED event before queue start) (#498
Browse files Browse the repository at this point in the history
)
  • Loading branch information
wkozyra95 authored Apr 8, 2024
1 parent 1712e06 commit 84f8fb8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions compositor_pipeline/src/queue/audio_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,13 @@ impl AudioQueueInput {
/// Drops samples that won't be used for processing. This function should only be called before
/// queue start.
fn drop_old_samples_before_start(&mut self) {
if self.offset.is_some() {
// if offset is defined never drop frames before start.
let Some(start_input_stream) = self.input_start_time() else {
// before first frame, so nothing to do
return;
};

let Some(start_input_stream) = self.input_start_time() else {
// before first frame, so nothing to do
if self.offset.is_some() {
// if offset is defined never drop frames before start.
return;
};

Expand Down
8 changes: 4 additions & 4 deletions compositor_pipeline/src/queue/video_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,13 @@ impl VideoQueueInput {
/// Drops frames that won't be used for processing. This function should only be called before
/// queue start.
fn drop_old_frames_before_start(&mut self) {
if self.offset.is_some() {
// if offset is defined never drop frames before start.
let Some(start_input_stream) = self.input_start_time() else {
// before first frame, so nothing to do
return;
};

let Some(start_input_stream) = self.input_start_time() else {
// before first frame, so nothing to do
if self.offset.is_some() {
// if offset is defined never drop frames before start.
return;
};

Expand Down
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ fn try_read_config() -> Result<Config, String> {
let ahead_of_time_processing: bool =
match env::var("LIVE_COMPOSITOR_AHEAD_OF_TIME_PROCESSING_ENABLE") {
Ok(enable) => bool_env_from_str(&enable).unwrap_or(offline_processing),
Err(_) => false,
Err(_) => offline_processing,
};

let never_drop_output_frames: bool = match env::var("LIVE_COMPOSITOR_NEVER_DROP_OUTPUT_FRAMES")
{
Ok(enable) => bool_env_from_str(&enable).unwrap_or(offline_processing),
Err(_) => false,
Err(_) => offline_processing,
};

let run_late_scheduled_events = match env::var("LIVE_COMPOSITOR_RUN_LATE_SCHEDULED_EVENTS") {
Expand Down

0 comments on commit 84f8fb8

Please sign in to comment.