]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Fix handling of DISCONNECT state
authorTakashi Iwai <tiwai@suse.de>
Tue, 11 Jan 2005 17:42:49 +0000 (17:42 +0000)
committerTakashi Iwai <tiwai@suse.de>
Tue, 11 Jan 2005 17:42:49 +0000 (17:42 +0000)
Fixed the handling of DISCONNECT state in dmix (not to set bogus error
values to state).

src/pcm/pcm_dmix.c

index 45a5b929bcf7ba4e4545e9e25dbbf02b8ae037c9..3fdbf4b212fad9e1297d3b069ecf507ecfbe435f 100644 (file)
@@ -405,7 +405,7 @@ static int snd_pcm_dmix_sync_ptr(snd_pcm_t *pcm)
        
        switch (snd_pcm_state(dmix->spcm)) {
        case SND_PCM_STATE_DISCONNECTED:
-               dmix->state = -ENOTTY;
+               dmix->state = SND_PCM_STATE_DISCONNECTED;
                return -ENOTTY;
        default:
                break;
@@ -474,7 +474,7 @@ static snd_pcm_state_t snd_pcm_dmix_state(snd_pcm_t *pcm)
        case SND_PCM_STATE_SUSPENDED:
                return -ESTRPIPE;
        case SND_PCM_STATE_DISCONNECTED:
-               dmix->state = -ENOTTY;
+               dmix->state = SND_PCM_STATE_DISCONNECTED;
                return -ENOTTY;
        default:
                break;