mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
spa: bluez: backend-native: fix type and add error checking
This commit is contained in:
parent
8881030904
commit
c24594a8ac
1 changed files with 3 additions and 3 deletions
|
|
@ -752,10 +752,10 @@ static bool rfcomm_hfp_ag(struct rfcomm *rfcomm, char* buf)
|
|||
int cntr = 0;
|
||||
|
||||
while ((token = strsep(&buf, "=,"))) {
|
||||
unsigned int codec_id;
|
||||
|
||||
/* skip token 0 i.e. the "AT+BAC=" part */
|
||||
if (cntr > 0) {
|
||||
int codec_id;
|
||||
sscanf (token, "%u", &codec_id);
|
||||
if (cntr > 0 && sscanf(token, "%u", &codec_id) == 1) {
|
||||
spa_log_debug(backend->log, "RFCOMM AT+BAC found codec %u", codec_id);
|
||||
if (codec_id == HFP_AUDIO_CODEC_MSBC) {
|
||||
rfcomm->msbc_supported_by_hfp = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue