mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	correct latency calculation
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@197 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
		
							parent
							
								
									1231598206
								
							
						
					
					
						commit
						fbefe67d52
					
				
					 4 changed files with 21 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -144,6 +144,7 @@ static void io_callback(struct pa_mainloop_api*a, struct pa_io_event *e, int fd,
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
static pa_usec_t sink_get_latency_cb(struct pa_sink *s) {
 | 
			
		||||
    pa_usec_t r = 0;
 | 
			
		||||
    struct userdata *u = s->userdata;
 | 
			
		||||
    snd_pcm_sframes_t frames;
 | 
			
		||||
    assert(s && u && u->sink);
 | 
			
		||||
| 
						 | 
				
			
			@ -157,7 +158,12 @@ static pa_usec_t sink_get_latency_cb(struct pa_sink *s) {
 | 
			
		|||
    if (frames < 0)
 | 
			
		||||
        frames = 0;
 | 
			
		||||
    
 | 
			
		||||
    return pa_bytes_to_usec(frames * u->frame_size, &s->sample_spec);
 | 
			
		||||
    r += pa_bytes_to_usec(frames * u->frame_size, &s->sample_spec);
 | 
			
		||||
 | 
			
		||||
    if (u->memchunk.memblock)
 | 
			
		||||
        r += pa_bytes_to_usec(u->memchunk.length, &s->sample_spec);
 | 
			
		||||
 | 
			
		||||
    return r;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int pa__init(struct pa_core *c, struct pa_module*m) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue