]> git.alsa-project.org Git - alsa-oss.git/commitdiff
Fix periods_max setting
authorTakashi Iwai <tiwai@suse.de>
Mon, 27 Dec 2004 18:47:01 +0000 (18:47 +0000)
committerTakashi Iwai <tiwai@suse.de>
Mon, 27 Dec 2004 18:47:01 +0000 (18:47 +0000)
Fixed the setting of periods_max not to be below periods_min.

alsa/pcm.c

index f01fa341f5d22c3cb32968292ba67b8374d710b5..d8d76446b5d3cecf011673a203a18bebecfed9df 100644 (file)
@@ -267,7 +267,8 @@ static int oss_dsp_hw_params(oss_dsp_t *dsp)
                        if (err < 0)
                                return err;
                        if (dsp->maxfrags > 0) {
-                               unsigned int periods_max = dsp->maxfrags;
+                               unsigned int periods_max = periods_min > dsp->maxfrags
+                                       ? periods_min : dsp->maxfrags;
                                err = snd_pcm_hw_params_set_periods_max(pcm, hw,
                                                                        &periods_max, 0);
                                if (err < 0)