Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Refactor timestamp update logic in Mp4Muxer

Richie McIlroyd0d6b10c9c9d
diff --git a/crates/recording/src/output_pipeline/ffmpeg.rs b/crates/recording/src/output_pipeline/ffmpeg.rs
index a54336577..37ec3b826 100644
--- a/crates/recording/src/output_pipeline/ffmpeg.rs
+++ b/crates/recording/src/output_pipeline/ffmpeg.rs
@@ -110,10 +110,10 @@ impl VideoMuxer for Mp4Muxer {
) -> anyhow::Result<()> {
if let Some(video_encoder) = self.video_encoder.as_mut() {
if let Some(frame_duration) = self.video_frame_duration {
- if let Some(last_ts) = self.last_video_ts {
- if timestamp <= last_ts {
- timestamp = last_ts + frame_duration;
- }
+ if let Some(last_ts) = self.last_video_ts
+ && timestamp <= last_ts
+ {
+ timestamp = last_ts + frame_duration;
}
self.last_video_ts = Some(timestamp);