diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2010-08-28 17:52:27 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-08-28 17:52:27 +0000 |
commit | 5628096e51f05f3b1b935dadf934f91a4928d018 (patch) | |
tree | e63df06142278e556b2adfc1478c2028ec1a807d /apps/plugins | |
parent | 67096fae73ff9d0d0071a8dae8144526ee0803c6 (diff) | |
download | rockbox-5628096e51f05f3b1b935dadf934f91a4928d018.tar.gz rockbox-5628096e51f05f3b1b935dadf934f91a4928d018.zip |
pitch_detector: avoid a division by zero when changing 'lowest frequency' setting
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27917 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/pitch_detector.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/plugins/pitch_detector.c b/apps/plugins/pitch_detector.c index b3003cd522..36e7059c1f 100644 --- a/apps/plugins/pitch_detector.c +++ b/apps/plugins/pitch_detector.c | |||
@@ -1143,7 +1143,11 @@ void init_everything(void) | |||
1143 | sample_rate = rb->rec_freq_sampr[sample_rate]; | 1143 | sample_rate = rb->rec_freq_sampr[sample_rate]; |
1144 | rb->pcm_set_frequency(sample_rate | SAMPR_TYPE_REC); | 1144 | rb->pcm_set_frequency(sample_rate | SAMPR_TYPE_REC); |
1145 | rb->pcm_init_recording(); | 1145 | rb->pcm_init_recording(); |
1146 | 1146 | ||
1147 | /* avoid divsion by zero */ | ||
1148 | if(tuner_settings.lowest_freq == 0) | ||
1149 | tuner_settings.lowest_freq = period2freq(BUFFER_SIZE / 4); | ||
1150 | |||
1147 | /* GUI */ | 1151 | /* GUI */ |
1148 | #if LCD_DEPTH > 1 | 1152 | #if LCD_DEPTH > 1 |
1149 | front_color = rb->lcd_get_foreground(); | 1153 | front_color = rb->lcd_get_foreground(); |