mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	bluez5: fix minor error handling/warning issues
This commit is contained in:
		
							parent
							
								
									84d2b2ce3a
								
							
						
					
					
						commit
						783fbc507b
					
				
					 3 changed files with 14 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -415,7 +415,7 @@ static void *codec_init(const struct a2dp_codec *codec, uint32_t flags,
 | 
			
		|||
	return this;
 | 
			
		||||
 | 
			
		||||
error:
 | 
			
		||||
	if (this->aacenc)
 | 
			
		||||
	if (this && this->aacenc)
 | 
			
		||||
		aacEncClose(&this->aacenc);
 | 
			
		||||
	free(this);
 | 
			
		||||
	errno = -res;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -743,7 +743,7 @@ again:
 | 
			
		|||
		 * => timeout = (quantum - max_excess)/quantum * packet_time
 | 
			
		||||
		 */
 | 
			
		||||
		uint64_t max_excess = 2*256;
 | 
			
		||||
		uint64_t packet_samples = this->frame_count * this->block_size / port->frame_size;
 | 
			
		||||
		uint64_t packet_samples = (uint64_t)this->frame_count * this->block_size / port->frame_size;
 | 
			
		||||
		uint64_t packet_time = packet_samples * SPA_NSEC_PER_SEC / port->current_format.info.raw.rate;
 | 
			
		||||
		uint64_t quantum = SPA_LIKELY(this->clock) ? this->clock->duration : 0;
 | 
			
		||||
		uint64_t timeout = (quantum > max_excess) ?
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3293,18 +3293,20 @@ static int bluez_register_endpoint(struct spa_bt_monitor *monitor,
 | 
			
		|||
 | 
			
		||||
	ret = a2dp_codec_to_endpoint(codec, endpoint, &object_path);
 | 
			
		||||
	if (ret < 0)
 | 
			
		||||
		return ret;
 | 
			
		||||
		goto error;
 | 
			
		||||
 | 
			
		||||
	caps_size = codec->fill_caps(codec, 0, caps);
 | 
			
		||||
	if (caps_size < 0)
 | 
			
		||||
		return caps_size;
 | 
			
		||||
	ret = caps_size = codec->fill_caps(codec, 0, caps);
 | 
			
		||||
	if (ret < 0)
 | 
			
		||||
		goto error;
 | 
			
		||||
 | 
			
		||||
	m = dbus_message_new_method_call(BLUEZ_SERVICE,
 | 
			
		||||
	                                 path,
 | 
			
		||||
	                                 BLUEZ_MEDIA_INTERFACE,
 | 
			
		||||
	                                 "RegisterEndpoint");
 | 
			
		||||
	if (m == NULL)
 | 
			
		||||
		return -EIO;
 | 
			
		||||
	if (m == NULL) {
 | 
			
		||||
		ret = -EIO;
 | 
			
		||||
		goto error;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	dbus_message_iter_init_append(m, &object_it);
 | 
			
		||||
	dbus_message_iter_append_basic(&object_it, DBUS_TYPE_OBJECT_PATH, &object_path);
 | 
			
		||||
| 
						 | 
				
			
			@ -3327,6 +3329,10 @@ static int bluez_register_endpoint(struct spa_bt_monitor *monitor,
 | 
			
		|||
	free(object_path);
 | 
			
		||||
 | 
			
		||||
	return 0;
 | 
			
		||||
 | 
			
		||||
error:
 | 
			
		||||
	free(object_path);
 | 
			
		||||
	return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int register_a2dp_endpoint(struct spa_bt_monitor *monitor,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue