Skip to content

Commit 839cf0f

Browse files
committed
@remotion/compositor: Fix a crash in Rust code
1 parent 7aeee1a commit 839cf0f

File tree

9 files changed

+3
-3
lines changed

9 files changed

+3
-3
lines changed
0 Bytes
Binary file not shown.
8 Bytes
Binary file not shown.
-32 Bytes
Binary file not shown.
-40 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
-7 Bytes
Binary file not shown.

packages/compositor/rust/opened_stream.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ impl OpenedStream {
241241
one_frame_in_time_base,
242242
match freshly_seeked || self.last_position.is_none() {
243243
true => None,
244-
false => Some(self.last_position.unwrap()),
244+
false => Some(self.last_position.unwrap_or(0)),
245245
},
246246
tone_mapped,
247247
frame_cache_manager,
@@ -357,7 +357,7 @@ impl OpenedStream {
357357

358358
let previous_pts = match freshly_seeked || self.last_position.is_none() {
359359
true => None,
360-
false => Some(self.last_position.unwrap()),
360+
false => Some(self.last_position.unwrap_or(0)),
361361
};
362362
let item = FrameCacheItem {
363363
resolved_pts: unfiltered.pts().expect("expected pts"),

packages/compositor/rust/opened_video_manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl OpenedVideoManager {
147147
stream_index,
148148
OpenStream {
149149
src: video.src.clone(),
150-
last_time: video.last_position.unwrap() as f64
150+
last_time: video.last_position.unwrap_or(0) as f64
151151
/ (video.time_base.1 as f64 / video.time_base.0 as f64),
152152
id: stream_index,
153153
transparent: video.transparent,

0 commit comments

Comments
 (0)