mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	Fix control flow in pa_oss_open(). Also fall back to half duplex when device doesn't
support full. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@826 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
		
							parent
							
								
									27cee2ef52
								
							
						
					
					
						commit
						c2c9f25100
					
				
					 1 changed files with 6 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -56,9 +56,11 @@ int pa_oss_open(const char *device, int *mode, int* pcaps) {
 | 
			
		|||
            }
 | 
			
		||||
 | 
			
		||||
            if (*tcaps & DSP_CAP_DUPLEX)
 | 
			
		||||
                return fd;
 | 
			
		||||
                goto success;
 | 
			
		||||
 | 
			
		||||
            goto fail;
 | 
			
		||||
            pa_log_warn(__FILE__": '%s' doesn't support full duplex", device);
 | 
			
		||||
 | 
			
		||||
            close(fd);
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        if ((fd = open(device, (*mode = O_WRONLY)|O_NDELAY)) < 0) {
 | 
			
		||||
| 
						 | 
				
			
			@ -74,6 +76,8 @@ int pa_oss_open(const char *device, int *mode, int* pcaps) {
 | 
			
		|||
        }
 | 
			
		||||
    } 
 | 
			
		||||
 | 
			
		||||
success:
 | 
			
		||||
 | 
			
		||||
    if (pcaps) {
 | 
			
		||||
        if (ioctl(fd, SNDCTL_DSP_GETCAPS, pcaps) < 0) {
 | 
			
		||||
            pa_log(__FILE__": SNDCTL_DSP_GETCAPS: %s", strerror(errno));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue