Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/opentake-agent/src/mcp/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ impl Dispatcher {
opacity: a.opacity,
transform: a.transform.map(transform_from_arg),
text_content: a.content.clone(),
..Default::default()
};
let res = self.apply(EditCommand::SetClipProperties {
clip_ids,
Expand Down
6 changes: 6 additions & 0 deletions crates/opentake-media/src/decode/pcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ pub fn extract_pcm(path: &Path, spec: &PcmSpec, range: Option<(f64, f64)>) -> Re
if !status.success() && raw.is_empty() {
return Err(MediaError::no_track("audio", path));
}
// ffmpeg can exit 0 with empty stdout when metadata says audio exists but
// no decodable samples: treat as no audio track so the waveform cache
// isn't poisoned with all-1.0 silence.
if raw.is_empty() {
return Err(MediaError::no_track("audio", path));
}

let samples = raw_to_mono_f32(&raw, spec);
Ok(PcmBuffer {
Expand Down
5 changes: 5 additions & 0 deletions crates/opentake-media/src/waveform/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ pub fn load_waveform(cache_root: &Path, key: &str) -> Option<Vec<f32>> {
while let Ok(v) = cursor.read_f32::<LittleEndian>() {
out.push(v);
}
// Reject poison files: every bucket == 1.0 silence is what an older build
// cached when extract_pcm returned an empty Vec. Force regeneration.
if !out.is_empty() && out.iter().all(|&v| v == 1.0) {
return None;
}
Some(out)
}

Expand Down
Loading
Loading