]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Corrected pause callback
authorJaroslav Kysela <perex@perex.cz>
Sun, 9 Feb 2003 18:55:11 +0000 (18:55 +0000)
committerJaroslav Kysela <perex@perex.cz>
Sun, 9 Feb 2003 18:55:11 +0000 (18:55 +0000)
src/pcm/pcm_null.c

index 04202a6f974d637994d5a471ffd150bb5af3c0b7..c77038507bb5f16f79215dd627e6272b9525b4a8 100644 (file)
@@ -161,9 +161,12 @@ static int snd_pcm_null_pause(snd_pcm_t *pcm, int enable)
        if (enable) {
                if (null->state != SND_PCM_STATE_RUNNING)
                        return -EBADFD;
-       } else if (null->state != SND_PCM_STATE_PAUSED)
-               return -EBADFD;
-       null->state = SND_PCM_STATE_PAUSED;
+               null->state = SND_PCM_STATE_PAUSED;
+       } else {
+               if (null->state != SND_PCM_STATE_PAUSED)
+                       return -EBADFD;
+               null->state = SND_PCM_STATE_RUNNING;
+       }
        return 0;
 }