mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-04-15 08:21:11 -04:00
bluez5: backend-native: Fix rfcomm_send_volume_cmd()
This function always returns true. Change to not returning anything.
This commit is contained in:
parent
8e62b08e58
commit
533c67710e
1 changed files with 13 additions and 23 deletions
|
|
@ -537,7 +537,7 @@ static bool rfcomm_hsp_ag(struct rfcomm *rfcomm, char* buf)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool rfcomm_send_volume_cmd(struct rfcomm *rfcomm, int id)
|
static void rfcomm_send_volume_cmd(struct rfcomm *rfcomm, int id)
|
||||||
{
|
{
|
||||||
struct spa_bt_transport_volume *t_volume;
|
struct spa_bt_transport_volume *t_volume;
|
||||||
const char *format;
|
const char *format;
|
||||||
|
|
@ -565,8 +565,6 @@ static bool rfcomm_send_volume_cmd(struct rfcomm *rfcomm, int id)
|
||||||
spa_assert_not_reached();
|
spa_assert_not_reached();
|
||||||
|
|
||||||
rfcomm_send_cmd(rfcomm, "%s=%d", format, hw_volume);
|
rfcomm_send_cmd(rfcomm, "%s=%d", format, hw_volume);
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool rfcomm_hsp_hs(struct rfcomm *rfcomm, char* buf)
|
static bool rfcomm_hsp_hs(struct rfcomm *rfcomm, char* buf)
|
||||||
|
|
@ -595,15 +593,11 @@ static bool rfcomm_hsp_hs(struct rfcomm *rfcomm, char* buf)
|
||||||
}
|
}
|
||||||
} else if (spa_streq(buf, "OK")) {
|
} else if (spa_streq(buf, "OK")) {
|
||||||
if (rfcomm->hs_state == hsp_hs_init2) {
|
if (rfcomm->hs_state == hsp_hs_init2) {
|
||||||
if (rfcomm_send_volume_cmd(rfcomm, SPA_BT_VOLUME_ID_RX))
|
rfcomm_send_volume_cmd(rfcomm, SPA_BT_VOLUME_ID_RX);
|
||||||
rfcomm->hs_state = hsp_hs_vgs;
|
rfcomm->hs_state = hsp_hs_vgs;
|
||||||
else
|
|
||||||
rfcomm->hs_state = hsp_hs_init1;
|
|
||||||
} else if (rfcomm->hs_state == hsp_hs_vgs) {
|
} else if (rfcomm->hs_state == hsp_hs_vgs) {
|
||||||
if (rfcomm_send_volume_cmd(rfcomm, SPA_BT_VOLUME_ID_TX))
|
rfcomm_send_volume_cmd(rfcomm, SPA_BT_VOLUME_ID_TX);
|
||||||
rfcomm->hs_state = hsp_hs_vgm;
|
rfcomm->hs_state = hsp_hs_vgm;
|
||||||
else
|
|
||||||
rfcomm->hs_state = hsp_hs_init1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2464,13 +2458,13 @@ static bool rfcomm_hfp_hf(struct rfcomm *rfcomm, char* token)
|
||||||
/* Report volume on SLC establishment */
|
/* Report volume on SLC establishment */
|
||||||
SPA_FALLTHROUGH;
|
SPA_FALLTHROUGH;
|
||||||
case hfp_hf_slc2:
|
case hfp_hf_slc2:
|
||||||
if (rfcomm_send_volume_cmd(rfcomm, SPA_BT_VOLUME_ID_RX))
|
rfcomm_send_volume_cmd(rfcomm, SPA_BT_VOLUME_ID_RX);
|
||||||
rfcomm->hf_state = hfp_hf_vgs;
|
rfcomm->hf_state = hfp_hf_vgs;
|
||||||
break;
|
break;
|
||||||
case hfp_hf_vgs:
|
case hfp_hf_vgs:
|
||||||
rfcomm->hf_state = hfp_hf_slc1;
|
rfcomm->hf_state = hfp_hf_slc1;
|
||||||
if (rfcomm_send_volume_cmd(rfcomm, SPA_BT_VOLUME_ID_TX))
|
rfcomm_send_volume_cmd(rfcomm, SPA_BT_VOLUME_ID_TX);
|
||||||
rfcomm->hf_state = hfp_hf_vgm;
|
rfcomm->hf_state = hfp_hf_vgm;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
@ -2999,15 +2993,11 @@ static void sco_listen_event(struct spa_source *source)
|
||||||
|
|
||||||
/* Report initial volume to remote */
|
/* Report initial volume to remote */
|
||||||
if (t->profile == SPA_BT_PROFILE_HSP_AG) {
|
if (t->profile == SPA_BT_PROFILE_HSP_AG) {
|
||||||
if (rfcomm_send_volume_cmd(rfcomm, SPA_BT_VOLUME_ID_RX))
|
rfcomm_send_volume_cmd(rfcomm, SPA_BT_VOLUME_ID_RX);
|
||||||
rfcomm->hs_state = hsp_hs_vgs;
|
rfcomm->hs_state = hsp_hs_vgs;
|
||||||
else
|
|
||||||
rfcomm->hs_state = hsp_hs_init1;
|
|
||||||
} else if (t->profile == SPA_BT_PROFILE_HFP_AG) {
|
} else if (t->profile == SPA_BT_PROFILE_HFP_AG) {
|
||||||
if (rfcomm_send_volume_cmd(rfcomm, SPA_BT_VOLUME_ID_RX))
|
rfcomm_send_volume_cmd(rfcomm, SPA_BT_VOLUME_ID_RX);
|
||||||
rfcomm->hf_state = hfp_hf_vgs;
|
rfcomm->hf_state = hfp_hf_vgs;
|
||||||
else
|
|
||||||
rfcomm->hf_state = hfp_hf_slc1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
spa_bt_transport_set_state(t, SPA_BT_TRANSPORT_STATE_PENDING);
|
spa_bt_transport_set_state(t, SPA_BT_TRANSPORT_STATE_PENDING);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue