mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	pcm: dmix: Return error when slave is in OPEN or DISCONNECTED
A slave PCM in OPEN or DISCONNECTED state can't be used properly at all, so the best option is to return -EBADFD error. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
		
							parent
							
								
									8feb96ed9b
								
							
						
					
					
						commit
						614ce73d3d
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -822,12 +822,14 @@ int snd_pcm_direct_prepare(snd_pcm_t *pcm)
 | 
			
		|||
	case SND_PCM_STATE_SETUP:
 | 
			
		||||
	case SND_PCM_STATE_XRUN:
 | 
			
		||||
	case SND_PCM_STATE_SUSPENDED:
 | 
			
		||||
	case SND_PCM_STATE_DISCONNECTED:
 | 
			
		||||
		err = snd_pcm_prepare(dmix->spcm);
 | 
			
		||||
		if (err < 0)
 | 
			
		||||
			return err;
 | 
			
		||||
		snd_pcm_start(dmix->spcm);
 | 
			
		||||
		break;
 | 
			
		||||
	case SND_PCM_STATE_OPEN:
 | 
			
		||||
	case SND_PCM_STATE_DISCONNECTED:
 | 
			
		||||
		return -EBADFD;
 | 
			
		||||
	}
 | 
			
		||||
	snd_pcm_direct_check_interleave(dmix, pcm);
 | 
			
		||||
	dmix->state = SND_PCM_STATE_PREPARED;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue