]> git.alsa-project.org Git - alsa-oss.git/commitdiff
dsp->oss_format was used before it was set correctly
authorAlexander E. Patrakov <>
Sat, 6 Oct 2007 17:32:52 +0000 (19:32 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sat, 6 Oct 2007 17:32:52 +0000 (19:32 +0200)
spotted by running "aoss flite_time 10:00"
Signed-Off-By: Alexander E. Patrakov
alsa/pcm.c

index f5ec83d9f199d61ab8890d1d4de49c22b5cdb40e..76dc916aa298f0f0f6adff3725eda3a2c18a1cce 100644 (file)
@@ -215,10 +215,10 @@ static int oss_dsp_hw_params(oss_dsp_t *dsp)
                unsigned int rate, periods_min;
                if (!pcm)
                        continue;
+               dsp->format = oss_format_to_alsa(dsp->oss_format);
                str->frame_bytes = snd_pcm_format_physical_width(dsp->format) * dsp->channels / 8;
                snd_pcm_hw_params_alloca(&hw);
                snd_pcm_hw_params_any(pcm, hw);
-               dsp->format = oss_format_to_alsa(dsp->oss_format);
 
                err = snd_pcm_hw_params_set_format(pcm, hw, dsp->format);
                if (err < 0)