Fix return value for pjsua_set_snd_dev2() with no sound device option (#3809)
* Fix return value for pjsua_set_snd_dev2() with no sound device option * Move initialization * modification based on comments
This commit is contained in:
parent
42a3e78d75
commit
b981b45183
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue