summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2006-03-08 20:38:16 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2006-03-08 20:38:16 +0000
commit311f73264b34dd2f24fe91cc63bc041d4cdb63e0 (patch)
tree0ab081af2bccede734b75541396fcfddf6b70155
parent35dcf909a1bde15baa89b954a02903d1b8725622 (diff)
downloadrockbox-311f73264b34dd2f24fe91cc63bc041d4cdb63e0.zip
rockbox-311f73264b34dd2f24fe91cc63bc041d4cdb63e0.tar.gz
rockbox-311f73264b34dd2f24fe91cc63bc041d4cdb63e0.tar.bz2
rockbox-311f73264b34dd2f24fe91cc63bc041d4cdb63e0.tar.xz
Make clipping detection more sensitive for swcodec platforms by triggering on the first peak value
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8962 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/recorder/peakmeter.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c
index 571571d..8bcc068 100644
--- a/apps/recorder/peakmeter.c
+++ b/apps/recorder/peakmeter.c
@@ -563,16 +563,26 @@ void peak_meter_peek(void)
of the volume are at full scale. This is proven
to be inaccurate in both ways: it may detect clips
when no clip occurred and it may fail to detect
- a real clip. */
+ a real clip. For software codecs, the peak is already
+ the max of a bunch of samples, so use one max value
+ or you fail to detect clipping! */
+#if CONFIG_CODEC == SWCODEC
+ if (left == MAX_PEAK - 1) {
+#else
if ((left == pm_max_left) &&
(left == MAX_PEAK - 1)) {
+#endif
pm_clip_left = true;
pm_clip_timeout_l =
current_tick + clip_time_out[pm_clip_hold];
}
+#if CONFIG_CODEC == SWCODEC
+ if (right == MAX_PEAK - 1) {
+#else
if ((right == pm_max_right) &&
(right == MAX_PEAK - 1)) {
+#endif
pm_clip_right = true;
pm_clip_timeout_r =
current_tick + clip_time_out[pm_clip_hold];