mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	protocol: signal when connection was closed
This commit is contained in:
		
							parent
							
								
									7ffaaf66a7
								
							
						
					
					
						commit
						95e27c27ca
					
				
					 1 changed files with 7 additions and 1 deletions
				
			
		| 
						 | 
					@ -502,10 +502,16 @@ on_remote_data(void *data, int fd, enum spa_io mask)
 | 
				
			||||||
	struct pw_core *core = pw_remote_get_core(this);
 | 
						struct pw_core *core = pw_remote_get_core(this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (mask & (SPA_IO_ERR | SPA_IO_HUP)) {
 | 
					        if (mask & (SPA_IO_ERR | SPA_IO_HUP)) {
 | 
				
			||||||
 | 
							enum pw_remote_state state;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		pw_log_error("protocol-native %p: got connection error", impl);
 | 
							pw_log_error("protocol-native %p: got connection error", impl);
 | 
				
			||||||
		pw_loop_destroy_source(pw_core_get_main_loop(core), impl->source);
 | 
							pw_loop_destroy_source(pw_core_get_main_loop(core), impl->source);
 | 
				
			||||||
		impl->source = NULL;
 | 
							impl->source = NULL;
 | 
				
			||||||
		pw_remote_update_state(this, PW_REMOTE_STATE_ERROR, "connection error");
 | 
							if (mask & SPA_IO_HUP)
 | 
				
			||||||
 | 
								state = PW_REMOTE_STATE_UNCONNECTED;
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								state = PW_REMOTE_STATE_ERROR;
 | 
				
			||||||
 | 
							pw_remote_update_state(this, state, "connection error");
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue