alsa: Simplify alsa_open().
authorAndre Noll <maan@systemlinux.org>
Sun, 15 Mar 2009 14:47:45 +0000 (15:47 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 15 Mar 2009 14:47:45 +0000 (15:47 +0100)
No need to call snd_pcm_info() as we do not use it anyway.

alsa_write.c

index 3a1e76e..d65cfb4 100644 (file)
@@ -62,7 +62,6 @@ static int alsa_open(struct writer_node *w)
        snd_pcm_sw_params_t *swparams;
        snd_pcm_uframes_t buffer_size, start_threshold, stop_threshold;
        int err;
-       snd_pcm_info_t *info;
        snd_pcm_uframes_t period_size;
        struct private_alsa_write_data *pad = para_calloc(sizeof(struct
                private_alsa_write_data));
@@ -79,13 +78,10 @@ static int alsa_open(struct writer_node *w)
                pad->channels = conf->channels_arg;
        PARA_INFO_LOG("%d channel(s), %dHz\n", pad->channels, pad->samplerate);
        w->private_data = pad;
-       snd_pcm_info_alloca(&info);
        err = snd_pcm_open(&pad->handle, conf->device_arg,
                SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK);
        if (err < 0)
                return -E_PCM_OPEN;
-       if ((err = snd_pcm_info(pad->handle, info)) < 0)
-               return -E_SND_PCM_INFO;
 
        snd_pcm_hw_params_alloca(&hwparams);
        snd_pcm_sw_params_alloca(&swparams);