mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	virtual-source: Don't process the rewind during requesting it
The request_rewind() callback of the uplink sink called pa_sink_process_rewind(), which is not allowed. Things are supposed to happen so that first a rewind is requested, and then during the next rtpoll loop the sink will process the request. Calling pa_sink_process_rewind() during the request phase caused a crash. Having a request_rewind() callback is completely unnecessary, because it's only useful for forwarding the request to a downstream sink. In this case there is no downstream sink. I also set max_rewind to 0, because the sink doesn't support rewinding. Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/775
This commit is contained in:
		
							parent
							
								
									bcc2162fb4
								
							
						
					
					
						commit
						a71136be52
					
				
					 1 changed files with 1 additions and 14 deletions
				
			
		| 
						 | 
					@ -151,18 +151,6 @@ static void sink_update_requested_latency_cb(pa_sink *s) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Called from I/O thread context */
 | 
					 | 
				
			||||||
static void sink_request_rewind_cb(pa_sink *s) {
 | 
					 | 
				
			||||||
    struct userdata *u;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    pa_sink_assert_ref(s);
 | 
					 | 
				
			||||||
    pa_assert_se(u = s->userdata);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /* Do nothing */
 | 
					 | 
				
			||||||
    pa_sink_process_rewind(u->sink, 0);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/* Called from I/O thread context */
 | 
					/* Called from I/O thread context */
 | 
				
			||||||
static int source_process_msg_cb(pa_msgobject *o, int code, void *data, int64_t offset, pa_memchunk *chunk) {
 | 
					static int source_process_msg_cb(pa_msgobject *o, int code, void *data, int64_t offset, pa_memchunk *chunk) {
 | 
				
			||||||
    struct userdata *u = PA_SOURCE(o)->userdata;
 | 
					    struct userdata *u = PA_SOURCE(o)->userdata;
 | 
				
			||||||
| 
						 | 
					@ -675,7 +663,6 @@ int pa__init(pa_module*m) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        u->sink->parent.process_msg = sink_process_msg_cb;
 | 
					        u->sink->parent.process_msg = sink_process_msg_cb;
 | 
				
			||||||
        u->sink->update_requested_latency = sink_update_requested_latency_cb;
 | 
					        u->sink->update_requested_latency = sink_update_requested_latency_cb;
 | 
				
			||||||
        u->sink->request_rewind = sink_request_rewind_cb;
 | 
					 | 
				
			||||||
        u->sink->set_state_in_main_thread = sink_set_state_in_main_thread_cb;
 | 
					        u->sink->set_state_in_main_thread = sink_set_state_in_main_thread_cb;
 | 
				
			||||||
        u->sink->userdata = u;
 | 
					        u->sink->userdata = u;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -685,7 +672,7 @@ int pa__init(pa_module*m) {
 | 
				
			||||||
        /* FIXME: no idea what I am doing here */
 | 
					        /* FIXME: no idea what I am doing here */
 | 
				
			||||||
        u->block_usec = BLOCK_USEC;
 | 
					        u->block_usec = BLOCK_USEC;
 | 
				
			||||||
        nbytes = pa_usec_to_bytes(u->block_usec, &u->sink->sample_spec);
 | 
					        nbytes = pa_usec_to_bytes(u->block_usec, &u->sink->sample_spec);
 | 
				
			||||||
        pa_sink_set_max_rewind(u->sink, nbytes);
 | 
					        pa_sink_set_max_rewind(u->sink, 0);
 | 
				
			||||||
        pa_sink_set_max_request(u->sink, nbytes);
 | 
					        pa_sink_set_max_request(u->sink, nbytes);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        pa_sink_put(u->sink);
 | 
					        pa_sink_put(u->sink);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue