mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-15 08:56:38 -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;
|
return this;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
if (this->aacenc)
|
if (this && this->aacenc)
|
||||||
aacEncClose(&this->aacenc);
|
aacEncClose(&this->aacenc);
|
||||||
free(this);
|
free(this);
|
||||||
errno = -res;
|
errno = -res;
|
||||||
|
|
|
||||||
|
|
@ -743,7 +743,7 @@ again:
|
||||||
* => timeout = (quantum - max_excess)/quantum * packet_time
|
* => timeout = (quantum - max_excess)/quantum * packet_time
|
||||||
*/
|
*/
|
||||||
uint64_t max_excess = 2*256;
|
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 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 quantum = SPA_LIKELY(this->clock) ? this->clock->duration : 0;
|
||||||
uint64_t timeout = (quantum > max_excess) ?
|
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);
|
ret = a2dp_codec_to_endpoint(codec, endpoint, &object_path);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
goto error;
|
||||||
|
|
||||||
caps_size = codec->fill_caps(codec, 0, caps);
|
ret = caps_size = codec->fill_caps(codec, 0, caps);
|
||||||
if (caps_size < 0)
|
if (ret < 0)
|
||||||
return caps_size;
|
goto error;
|
||||||
|
|
||||||
m = dbus_message_new_method_call(BLUEZ_SERVICE,
|
m = dbus_message_new_method_call(BLUEZ_SERVICE,
|
||||||
path,
|
path,
|
||||||
BLUEZ_MEDIA_INTERFACE,
|
BLUEZ_MEDIA_INTERFACE,
|
||||||
"RegisterEndpoint");
|
"RegisterEndpoint");
|
||||||
if (m == NULL)
|
if (m == NULL) {
|
||||||
return -EIO;
|
ret = -EIO;
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
dbus_message_iter_init_append(m, &object_it);
|
dbus_message_iter_init_append(m, &object_it);
|
||||||
dbus_message_iter_append_basic(&object_it, DBUS_TYPE_OBJECT_PATH, &object_path);
|
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);
|
free(object_path);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
error:
|
||||||
|
free(object_path);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int register_a2dp_endpoint(struct spa_bt_monitor *monitor,
|
static int register_a2dp_endpoint(struct spa_bt_monitor *monitor,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue