Skip to content

Commit

Permalink
Fix return value for pjsua_set_snd_dev2() with no sound device option (
Browse files Browse the repository at this point in the history
…#3809)

* Fix return value for pjsua_set_snd_dev2() with no sound device option

* Move initialization

* modification based on comments
  • Loading branch information
trengginas authored Dec 28, 2023
1 parent 42a3e78 commit b981b45
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pjsip/src/pjsua-lib/pjsua_aud.c
Original file line number Diff line number Diff line change
Expand Up @@ -2228,7 +2228,7 @@ PJ_DEF(pj_status_t) pjsua_set_snd_dev2(const pjsua_snd_dev_param *snd_param)
unsigned alt_cr_cnt = 1;
unsigned alt_cr[] = {0, 44100, 48000, 32000, 16000, 8000};
unsigned i;
pj_status_t status = -1;
pj_status_t status = PJ_SUCCESS;
unsigned orig_snd_dev_mode = pjsua_var.snd_mode;

PJ_ASSERT_RETURN(snd_param, PJ_EINVAL);
Expand Down Expand Up @@ -2267,7 +2267,8 @@ PJ_DEF(pj_status_t) pjsua_set_snd_dev2(const pjsua_snd_dev_param *snd_param)
PJSUA_UNLOCK();
PJ_LOG(4, (THIS_FILE, "No sound device, mode setting is ignored"));
if (!pjsua_var.no_snd)
pjsua_set_no_snd_dev();
PJ_ASSERT_RETURN(pjsua_set_no_snd_dev(), PJ_ENOTFOUND);

pj_log_pop_indent();
return status;
}
Expand Down

0 comments on commit b981b45

Please sign in to comment.