[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/4] splitfx: round instead of truncate for CDDA
From: |
Eric Wong |
Subject: |
[PATCH 1/4] splitfx: round instead of truncate for CDDA |
Date: |
Sun, 8 Sep 2013 02:12:45 +0000 |
Rounding should be more accurate, even though my original awk
snippet truncated the output.
---
lib/dtas/splitfx.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/dtas/splitfx.rb b/lib/dtas/splitfx.rb
index 83ac190..7a5d705 100644
--- a/lib/dtas/splitfx.rb
+++ b/lib/dtas/splitfx.rb
@@ -234,7 +234,7 @@ class DTAS::SplitFX # :nodoc:
# taking into account CDDA alignment
if time.sub!(/\.(\d+)\z/, "")
s = "0.#$1".to_f * @infmt.rate / 75
- frac = s.to_i * 75
+ frac = s.round * 75
end
# feed the rest to the normal function
--
1.8.4