Skip to content

Commit

Permalink
Merge pull request #4891 from remotion-dev/compositor-dont-panic-on-l…
Browse files Browse the repository at this point in the history
…ast-position

`@remotion/compositor`: Fix a crash in Rust code
  • Loading branch information
JonnyBurger authored Feb 14, 2025
2 parents 06a00de + 753bc26 commit 2f06573
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/compositor/rust/opened_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl OpenedStream {
one_frame_in_time_base,
match freshly_seeked || self.last_position.is_none() {
true => None,
false => Some(self.last_position.unwrap()),
false => Some(self.last_position.unwrap_or(0)),
},
tone_mapped,
frame_cache_manager,
Expand Down Expand Up @@ -356,7 +356,7 @@ impl OpenedStream {

let previous_pts = match freshly_seeked || self.last_position.is_none() {
true => None,
false => Some(self.last_position.unwrap()),
false => Some(self.last_position.unwrap_or(0)),
};
let item = FrameCacheItem {
resolved_pts: unfiltered.pts().expect("expected pts"),
Expand Down
2 changes: 1 addition & 1 deletion packages/compositor/rust/opened_video_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ impl OpenedVideoManager {
stream_index,
OpenStream {
src: video.src.clone(),
last_time: video.last_position.unwrap() as f64
last_time: video.last_position.unwrap_or(0) as f64
/ (video.time_base.1 as f64 / video.time_base.0 as f64),
id: stream_index,
transparent: video.transparent,
Expand Down

0 comments on commit 2f06573

Please sign in to comment.