mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	Having constant deferred events isn't allowed and causes problems. Use timers
instead. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@757 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
		
							parent
							
								
									4bb5822618
								
							
						
					
					
						commit
						6ae8511a66
					
				
					 2 changed files with 27 additions and 13 deletions
				
			
		| 
						 | 
				
			
			@ -79,8 +79,9 @@ int deny_severity = LOG_WARNING;
 | 
			
		|||
 | 
			
		||||
#ifdef OS_IS_WIN32
 | 
			
		||||
 | 
			
		||||
static void message_cb(pa_mainloop_api*a, pa_defer_event *e, void *userdata) {
 | 
			
		||||
static void message_cb(pa_mainloop_api*a, pa_time_event*e, PA_GCC_UNUSED const struct timeval *tv, void *userdata) {
 | 
			
		||||
    MSG msg;
 | 
			
		||||
    struct timeval tvnext;
 | 
			
		||||
 | 
			
		||||
    while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
 | 
			
		||||
        if (msg.message == WM_QUIT)
 | 
			
		||||
| 
						 | 
				
			
			@ -90,6 +91,9 @@ static void message_cb(pa_mainloop_api*a, pa_defer_event *e, void *userdata) {
 | 
			
		|||
            DispatchMessage(&msg);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    pa_timeval_add(pa_gettimeofday(&tvnext), 100000);
 | 
			
		||||
    a->time_restart(e, &tvnext);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			@ -153,7 +157,8 @@ int main(int argc, char *argv[]) {
 | 
			
		|||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef OS_IS_WIN32
 | 
			
		||||
    pa_defer_event *defer;
 | 
			
		||||
    pa_time_event *timer;
 | 
			
		||||
    struct timeval tv;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    pa_limit_caps();
 | 
			
		||||
| 
						 | 
				
			
			@ -386,8 +391,9 @@ int main(int argc, char *argv[]) {
 | 
			
		|||
#endif
 | 
			
		||||
    
 | 
			
		||||
#ifdef OS_IS_WIN32
 | 
			
		||||
    defer = pa_mainloop_get_api(mainloop)->defer_new(pa_mainloop_get_api(mainloop), message_cb, NULL);
 | 
			
		||||
    assert(defer);
 | 
			
		||||
    timer = pa_mainloop_get_api(mainloop)->time_new(
 | 
			
		||||
        pa_mainloop_get_api(mainloop), pa_gettimeofday(&tv), message_cb, NULL);
 | 
			
		||||
    assert(timer);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    if (conf->daemonize)
 | 
			
		||||
| 
						 | 
				
			
			@ -446,7 +452,7 @@ int main(int argc, char *argv[]) {
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
#ifdef OS_IS_WIN32
 | 
			
		||||
    pa_mainloop_get_api(mainloop)->defer_free(defer);
 | 
			
		||||
    pa_mainloop_get_api(mainloop)->time_free(timer);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    pa_core_free(c);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue