]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Added missing DRAINING state to snd_pcm_state_name()
authorJaroslav Kysela <perex@perex.cz>
Thu, 25 Oct 2001 13:51:26 +0000 (13:51 +0000)
committerJaroslav Kysela <perex@perex.cz>
Thu, 25 Oct 2001 13:51:26 +0000 (13:51 +0000)
src/pcm/pcm.c

index 4ff5df8c53d652e6dced6ac2c9417288b89df92e..aacdc85d01ff1771e14aa97546cce21f87b34b33 100644 (file)
@@ -99,7 +99,7 @@ int snd_pcm_close(snd_pcm_t *pcm)
        int err;
        assert(pcm);
        if (pcm->setup) {
-               if (pcm->mode & SND_PCM_NONBLOCK || 
+               if ((pcm->mode & SND_PCM_NONBLOCK) || 
                    pcm->stream == SND_PCM_STREAM_CAPTURE)
                        snd_pcm_drop(pcm);
                else
@@ -201,12 +201,13 @@ int snd_pcm_hw_free(snd_pcm_t *pcm)
 {
        int err;
        assert(pcm->setup);
-       assert(snd_pcm_state(pcm) <= SND_PCM_STATE_PREPARED);
        if (pcm->mmap_channels) {
                err = snd_pcm_munmap(pcm);
                if (err < 0)
                        return err;
        }
+       assert(snd_pcm_state(pcm) == SND_PCM_STATE_SETUP ||
+              snd_pcm_state(pcm) == SND_PCM_STATE_PREPARED);
        err = pcm->ops->hw_free(pcm->op_arg);
        pcm->setup = 0;
        if (err < 0)
@@ -592,6 +593,7 @@ static const char *snd_pcm_state_names[] = {
        STATE(PREPARED),
        STATE(RUNNING),
        STATE(XRUN),
+       STATE(DRAINING),
        STATE(PAUSED),
        STATE(SUSPENDED),
 };