diff options
author | Uwe Klotz <uklotz@mixxx.org> | 2020-04-06 21:52:13 +0200 |
---|---|---|
committer | Uwe Klotz <uklotz@mixxx.org> | 2020-04-06 22:13:27 +0200 |
commit | 6d4160c78cd216fe0760b0de69e9bc73608d891e (patch) | |
tree | 5634fef0a398d5b81507ee39a4bde1d40bde063b /src/audio | |
parent | e3bd16508964c3174e5dee6a40b87189f0850aac (diff) |
Add remarks about frame boundary alignment requirement
Diffstat (limited to 'src/audio')
-rw-r--r-- | src/audio/signalinfo.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/audio/signalinfo.h b/src/audio/signalinfo.h index 982f80d946..684ac660b5 100644 --- a/src/audio/signalinfo.h +++ b/src/audio/signalinfo.h @@ -81,6 +81,12 @@ class SignalInfo final { // Conversion: #samples / sample offset -> second offset // Only works for integer sample offsets on frame boundaries! + // + // Remark: Only generalize for arbitrary sample offsets when + // actually needed. Existing code may rely on the debug + // assertions that checks for frame boundary alignment! + // It is very unlikely that an integer sample offset/count + // is NOT supposed to address a frame boundary!! double samples2secs(SINT samples) const { return frames2secs(samples2frames(samples)); } @@ -93,6 +99,12 @@ class SignalInfo final { // Conversion: #samples / sample offset -> millisecond offset // Only works for integer sample offsets on frame boundaries! + // + // Remark: Only generalize for arbitrary sample offsets when + // actually needed. Existing code may rely on the debug + // assertions that checks for frame boundary alignment! + // It is very unlikely that an integer sample offset/count + // is NOT supposed to address a frame boundary!! double samples2millis(SINT samples) const { return frames2millis(samples2frames(samples)); } |