From 85437cd2070792e161e2d505c6ed2aba615d9d78 Mon Sep 17 00:00:00 2001 From: Bastian Kersting Date: Wed, 19 Mar 2025 13:50:08 +0000 Subject: [PATCH] Fix Default implementation for TimeBase A TimeBase represents symphonia's conversion factor between time. It does not make sense for it to have a factor of 0, which is also checked by its constructor TimeBase::new. Unfortunately the Default implementation for TimeBase is derived, yielding a value of 0 for both u32 members (numerator and denominator), which is probably not what we want. This change switches the default to be 1. Also fixes a typo in the doc comment for TimeStamp. --- symphonia-core/src/units.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/symphonia-core/src/units.rs b/symphonia-core/src/units.rs index 12fc4a7e..ad462d9f 100644 --- a/symphonia-core/src/units.rs +++ b/symphonia-core/src/units.rs @@ -9,7 +9,7 @@ use std::fmt; -/// A `TimeStamp` represents an instantenous instant in time since the start of a stream. One +/// A `TimeStamp` represents an instantaneous instant in time since the start of a stream. One /// `TimeStamp` "tick" is equivalent to the stream's `TimeBase` in seconds. pub type TimeStamp = u64; @@ -135,7 +135,7 @@ impl From