Skip to content

Commit

Permalink
WavPack: Add a TODO for unknown sample counts
Browse files Browse the repository at this point in the history
  • Loading branch information
Serial-ATA committed Apr 6, 2024
1 parent 17a9261 commit 25dd1e7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/wavpack/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@ where
offset += u64::from(block_header.block_size + 8);
}

// TODO: Support unknown sample counts in WavPack
if total_samples == !0 {
log::warn!("Unable to calculate duration, unknown sample counts are not yet supported");
return Ok(properties);
}

if total_samples == 0 || properties.sample_rate == 0 {
if parse_mode == ParsingMode::Strict {
decode_err!(@BAIL WavPack, "Unable to calculate duration (sample count == 0 || sample rate == 0)")
Expand Down

0 comments on commit 25dd1e7

Please sign in to comment.