mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-10-29 05:40:27 -04:00 
			
		
		
		
	alsa: handle errors from get status
And skip a cycle.
This commit is contained in:
		
							parent
							
								
									162f90ac3a
								
							
						
					
					
						commit
						080c40d938
					
				
					 1 changed files with 8 additions and 2 deletions
				
			
		|  | @ -2402,8 +2402,11 @@ static int alsa_write_sync(struct state *state, uint64_t current_time) | |||
| 	if (SPA_UNLIKELY((res = check_position_config(state)) < 0)) | ||||
| 		return res; | ||||
| 
 | ||||
| 	if (SPA_UNLIKELY((res = get_status(state, current_time, &avail, &delay, &target)) < 0)) | ||||
| 	if (SPA_UNLIKELY((res = get_status(state, current_time, &avail, &delay, &target)) < 0)) { | ||||
| 		spa_log_error(state->log, "get_status error"); | ||||
| 		state->next_time += state->threshold * 1e9 / state->rate; | ||||
| 		return res; | ||||
| 	} | ||||
| 
 | ||||
| 	if (SPA_UNLIKELY(!following && delay > target + state->max_error)) { | ||||
| 		spa_log_trace(state->log, "%p: early wakeup %ld %lu %lu", state, | ||||
|  | @ -2658,8 +2661,11 @@ static int alsa_read_sync(struct state *state, uint64_t current_time) | |||
| 	if (SPA_UNLIKELY((res = check_position_config(state)) < 0)) | ||||
| 		return res; | ||||
| 
 | ||||
| 	if (SPA_UNLIKELY((res = get_status(state, current_time, &avail, &delay, &target)) < 0)) | ||||
| 	if (SPA_UNLIKELY((res = get_status(state, current_time, &avail, &delay, &target)) < 0)) { | ||||
| 		spa_log_error(state->log, "get_status error"); | ||||
| 		state->next_time += state->threshold * 1e9 / state->rate; | ||||
| 		return res; | ||||
| 	} | ||||
| 
 | ||||
| 	if (SPA_UNLIKELY(!following && avail < state->read_size)) { | ||||
| 		spa_log_trace(state->log, "%p: early wakeup %ld %ld %ld %d", state, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Wim Taymans
						Wim Taymans