diff options
-rw-r--r-- | apps/recorder/peakmeter.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c index 571571de9e..8bcc0688a6 100644 --- a/apps/recorder/peakmeter.c +++ b/apps/recorder/peakmeter.c | |||
@@ -563,16 +563,26 @@ void peak_meter_peek(void) | |||
563 | of the volume are at full scale. This is proven | 563 | of the volume are at full scale. This is proven |
564 | to be inaccurate in both ways: it may detect clips | 564 | to be inaccurate in both ways: it may detect clips |
565 | when no clip occurred and it may fail to detect | 565 | when no clip occurred and it may fail to detect |
566 | a real clip. */ | 566 | a real clip. For software codecs, the peak is already |
567 | the max of a bunch of samples, so use one max value | ||
568 | or you fail to detect clipping! */ | ||
569 | #if CONFIG_CODEC == SWCODEC | ||
570 | if (left == MAX_PEAK - 1) { | ||
571 | #else | ||
567 | if ((left == pm_max_left) && | 572 | if ((left == pm_max_left) && |
568 | (left == MAX_PEAK - 1)) { | 573 | (left == MAX_PEAK - 1)) { |
574 | #endif | ||
569 | pm_clip_left = true; | 575 | pm_clip_left = true; |
570 | pm_clip_timeout_l = | 576 | pm_clip_timeout_l = |
571 | current_tick + clip_time_out[pm_clip_hold]; | 577 | current_tick + clip_time_out[pm_clip_hold]; |
572 | } | 578 | } |
573 | 579 | ||
580 | #if CONFIG_CODEC == SWCODEC | ||
581 | if (right == MAX_PEAK - 1) { | ||
582 | #else | ||
574 | if ((right == pm_max_right) && | 583 | if ((right == pm_max_right) && |
575 | (right == MAX_PEAK - 1)) { | 584 | (right == MAX_PEAK - 1)) { |
585 | #endif | ||
576 | pm_clip_right = true; | 586 | pm_clip_right = true; |
577 | pm_clip_timeout_r = | 587 | pm_clip_timeout_r = |
578 | current_tick + clip_time_out[pm_clip_hold]; | 588 | current_tick + clip_time_out[pm_clip_hold]; |