mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	Fix handling of PA_SINK_MESSAGE_GET_LATENCY
This commit is contained in:
		
							parent
							
								
									0d37b912ee
								
							
						
					
					
						commit
						123ba4f5f1
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -526,6 +526,7 @@ static int bt_hw_constraint(struct userdata *u) {
 | 
				
			||||||
static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offset, pa_memchunk *chunk) {
 | 
					static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offset, pa_memchunk *chunk) {
 | 
				
			||||||
    struct userdata *u = PA_SINK(o)->userdata;
 | 
					    struct userdata *u = PA_SINK(o)->userdata;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    pa_log/*_debug*/("got message: %d", code);
 | 
				
			||||||
    switch (code) {
 | 
					    switch (code) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        case PA_SINK_MESSAGE_SET_STATE:
 | 
					        case PA_SINK_MESSAGE_SET_STATE:
 | 
				
			||||||
| 
						 | 
					@ -550,7 +551,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
 | 
				
			||||||
            r = pa_smoother_get(u->smoother, pa_rtclock_usec());
 | 
					            r = pa_smoother_get(u->smoother, pa_rtclock_usec());
 | 
				
			||||||
            w = pa_bytes_to_usec(u->offset + u->memchunk.length, &u->sink->sample_spec);
 | 
					            w = pa_bytes_to_usec(u->offset + u->memchunk.length, &u->sink->sample_spec);
 | 
				
			||||||
            *((pa_usec_t*) data) = w > r ? w - r : 0;
 | 
					            *((pa_usec_t*) data) = w > r ? w - r : 0;
 | 
				
			||||||
            break;
 | 
					            return 0;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue