diff options
Diffstat (limited to 'apps/recorder/peakmeter.c')
-rw-r--r-- | apps/recorder/peakmeter.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c index fc68ce4267..8f32a837a7 100644 --- a/apps/recorder/peakmeter.c +++ b/apps/recorder/peakmeter.c | |||
@@ -66,7 +66,7 @@ static int pm_cur_left; /* current values (last peak_meter_peek) */ | |||
66 | static int pm_cur_right; | 66 | static int pm_cur_right; |
67 | static int pm_max_left; /* maximum values between peak meter draws */ | 67 | static int pm_max_left; /* maximum values between peak meter draws */ |
68 | static int pm_max_right; | 68 | static int pm_max_right; |
69 | #ifdef HAVE_AGC | 69 | #if defined(HAVE_AGC) || defined(HAVE_RECORDING_HISTOGRAM) |
70 | static int pm_peakhold_left; /* max. peak values between peakhold calls */ | 70 | static int pm_peakhold_left; /* max. peak values between peakhold calls */ |
71 | static int pm_peakhold_right; /* used for AGC and histogram display */ | 71 | static int pm_peakhold_right; /* used for AGC and histogram display */ |
72 | #endif | 72 | #endif |
@@ -799,9 +799,16 @@ static int peak_meter_read_l(void) | |||
799 | { | 799 | { |
800 | /* pm_max_left contains the maximum of all peak values that were read | 800 | /* pm_max_left contains the maximum of all peak values that were read |
801 | by peak_meter_peek since the last call of peak_meter_read_l */ | 801 | by peak_meter_peek since the last call of peak_meter_read_l */ |
802 | int retval = pm_max_left; | 802 | int retval; |
803 | |||
804 | #if defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC) | ||
805 | srand(current_tick); | ||
806 | pm_max_left = rand()%MAX_PEAK; | ||
807 | #endif | ||
803 | 808 | ||
804 | #ifdef HAVE_AGC | 809 | retval = pm_max_left; |
810 | |||
811 | #if defined(HAVE_RECORDING_HISTOGRAM) || defined(HAVE_AGC) | ||
805 | /* store max peak value for peak_meter_get_peakhold_x readout */ | 812 | /* store max peak value for peak_meter_get_peakhold_x readout */ |
806 | pm_peakhold_left = MAX(pm_max_left, pm_peakhold_left); | 813 | pm_peakhold_left = MAX(pm_max_left, pm_peakhold_left); |
807 | #endif | 814 | #endif |
@@ -812,11 +819,6 @@ static int peak_meter_read_l(void) | |||
812 | get fooled by an old maximum value */ | 819 | get fooled by an old maximum value */ |
813 | pm_max_left = pm_cur_left; | 820 | pm_max_left = pm_cur_left; |
814 | 821 | ||
815 | #if defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC) | ||
816 | srand(current_tick); | ||
817 | retval = rand()%MAX_PEAK; | ||
818 | #endif | ||
819 | |||
820 | return retval; | 822 | return retval; |
821 | } | 823 | } |
822 | 824 | ||
@@ -830,9 +832,16 @@ static int peak_meter_read_r(void) | |||
830 | { | 832 | { |
831 | /* peak_meter_r contains the maximum of all peak values that were read | 833 | /* peak_meter_r contains the maximum of all peak values that were read |
832 | by peak_meter_peek since the last call of peak_meter_read_r */ | 834 | by peak_meter_peek since the last call of peak_meter_read_r */ |
833 | int retval = pm_max_right; | 835 | int retval; |
836 | |||
837 | #if defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC) | ||
838 | srand(current_tick); | ||
839 | pm_max_right = rand()%MAX_PEAK; | ||
840 | #endif | ||
834 | 841 | ||
835 | #ifdef HAVE_AGC | 842 | retval = pm_max_right; |
843 | |||
844 | #if defined(HAVE_RECORDING_HISTOGRAM) || defined(HAVE_AGC) | ||
836 | /* store max peak value for peak_meter_get_peakhold_x readout */ | 845 | /* store max peak value for peak_meter_get_peakhold_x readout */ |
837 | pm_peakhold_right = MAX(pm_max_right, pm_peakhold_right); | 846 | pm_peakhold_right = MAX(pm_max_right, pm_peakhold_right); |
838 | #endif | 847 | #endif |
@@ -843,15 +852,10 @@ static int peak_meter_read_r(void) | |||
843 | get fooled by an old maximum value */ | 852 | get fooled by an old maximum value */ |
844 | pm_max_right = pm_cur_right; | 853 | pm_max_right = pm_cur_right; |
845 | 854 | ||
846 | #if defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC) | ||
847 | srand(current_tick); | ||
848 | retval = rand()%MAX_PEAK; | ||
849 | #endif | ||
850 | |||
851 | return retval; | 855 | return retval; |
852 | } | 856 | } |
853 | 857 | ||
854 | #ifdef HAVE_AGC | 858 | #if defined(HAVE_AGC) || defined(HAVE_RECORDING_HISTOGRAM) |
855 | /** | 859 | /** |
856 | * Reads out the current peak-hold values since the last call. | 860 | * Reads out the current peak-hold values since the last call. |
857 | * This is used by the histogram feature in the recording screen. | 861 | * This is used by the histogram feature in the recording screen. |