]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Fixes variable shadow problem in capture direction
authorAndreas Fenkart <afenkart@gmx.ch>
Mon, 22 Nov 2004 06:40:10 +0000 (06:40 +0000)
committerJaroslav Kysela <perex@perex.cz>
Mon, 22 Nov 2004 06:40:10 +0000 (06:40 +0000)
My gnomemeeting hung when accessing the microphone.
The problem was that the rate variable was not initialized when jumping to
the __partial label.
Signed-off-by: Andreas Fenkart <afenkart@gmx.ch>
src/pcm/pcm_rate.c

index 27fe4aa520b22c3861ea3e90619e64fa5d694a97..605cb49f9a6c39a7ba114cfcddad91b16654456b 100644 (file)
@@ -1068,7 +1068,7 @@ static int snd_pcm_rate_grab_next_period(snd_pcm_t *pcm, snd_pcm_uframes_t hw_of
        snd_pcm_uframes_t cont = pcm->buffer_size - hw_offset;
        const snd_pcm_channel_area_t *areas;
        const snd_pcm_channel_area_t *slave_areas;
-       snd_pcm_uframes_t slave_offset;
+       snd_pcm_uframes_t slave_offset, xfer;
        snd_pcm_uframes_t slave_frames = ULONG_MAX;
        snd_pcm_sframes_t result;
 
@@ -1091,9 +1091,6 @@ static int snd_pcm_rate_grab_next_period(snd_pcm_t *pcm, snd_pcm_uframes_t hw_of
                        return 0;
                }
        } else {
-               snd_pcm_rate_t *rate = pcm->private_data;
-               snd_pcm_uframes_t xfer;
-
                /* ok, grab first fragment */
                result = snd_pcm_mmap_begin(rate->slave, &slave_areas, &slave_offset, &slave_frames);
                if (result < 0)