mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-22 08:56:59 -05:00
bluez5: use the actual latency in a2dp-source
This commit is contained in:
parent
b19bd74b22
commit
ef74ef3654
1 changed files with 5 additions and 1 deletions
|
|
@ -745,10 +745,11 @@ static int impl_node_send_command(void *object, const struct spa_command *comman
|
||||||
|
|
||||||
static void emit_node_info(struct impl *this, bool full)
|
static void emit_node_info(struct impl *this, bool full)
|
||||||
{
|
{
|
||||||
|
char latency[64] = SPA_STRINGIFY(MIN_LATENCY)"/48000";
|
||||||
struct spa_dict_item node_info_items[] = {
|
struct spa_dict_item node_info_items[] = {
|
||||||
{ SPA_KEY_DEVICE_API, "bluez5" },
|
{ SPA_KEY_DEVICE_API, "bluez5" },
|
||||||
{ SPA_KEY_MEDIA_CLASS, "Stream/Output/Audio" },
|
{ SPA_KEY_MEDIA_CLASS, "Stream/Output/Audio" },
|
||||||
{ SPA_KEY_NODE_LATENCY, SPA_STRINGIFY(MIN_LATENCY)"/48000" },
|
{ SPA_KEY_NODE_LATENCY, latency },
|
||||||
{ "media.name", ((this->transport && this->transport->device->name) ?
|
{ "media.name", ((this->transport && this->transport->device->name) ?
|
||||||
this->transport->device->name : "A2DP") },
|
this->transport->device->name : "A2DP") },
|
||||||
};
|
};
|
||||||
|
|
@ -756,6 +757,9 @@ static void emit_node_info(struct impl *this, bool full)
|
||||||
if (full)
|
if (full)
|
||||||
this->info.change_mask = this->info_all;
|
this->info.change_mask = this->info_all;
|
||||||
if (this->info.change_mask) {
|
if (this->info.change_mask) {
|
||||||
|
if (this->transport && this->port.have_format)
|
||||||
|
snprintf(latency, sizeof(latency), "%d/%d", (int)this->props.min_latency,
|
||||||
|
(int)this->port.current_format.info.raw.rate);
|
||||||
this->info.props = &SPA_DICT_INIT_ARRAY(node_info_items);
|
this->info.props = &SPA_DICT_INIT_ARRAY(node_info_items);
|
||||||
spa_node_emit_info(&this->hooks, &this->info);
|
spa_node_emit_info(&this->hooks, &this->info);
|
||||||
this->info.change_mask = 0;
|
this->info.change_mask = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue