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 | |
| parent | 67096fae73ff9d0d0071a8dae8144526ee0803c6 (diff) | |
| download | rockbox-5628096e51f05f3b1b935dadf934f91a4928d018.zip rockbox-5628096e51f05f3b1b935dadf934f91a4928d018.tar.gz rockbox-5628096e51f05f3b1b935dadf934f91a4928d018.tar.bz2 rockbox-5628096e51f05f3b1b935dadf934f91a4928d018.tar.xz | |
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
| -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 b3003cd..36e7059 100644 --- a/apps/plugins/pitch_detector.c +++ b/apps/plugins/pitch_detector.c @@ -1143,7 +1143,11 @@ void init_everything(void) sample_rate = rb->rec_freq_sampr[sample_rate]; rb->pcm_set_frequency(sample_rate | SAMPR_TYPE_REC); rb->pcm_init_recording(); - + + /* avoid divsion by zero */ + if(tuner_settings.lowest_freq == 0) + tuner_settings.lowest_freq = period2freq(BUFFER_SIZE / 4); + /* GUI */ #if LCD_DEPTH > 1 front_color = rb->lcd_get_foreground(); |