diff --git a/test/call.c b/test/call.c index b87900cc33..cf5bad7c42 100644 --- a/test/call.c +++ b/test/call.c @@ -1799,22 +1799,26 @@ int test_call_progress(void) } -static int test_media_base(enum audio_mode txmode, enum aufmt fmt) +static int test_media_base(enum audio_mode txmode, + enum aufmt sndfmt, enum aufmt acfmt) { struct fixture fix, *f = &fix; struct cancel_rule *cr; struct auplay *auplay = NULL; int err = 0; - fixture_init_prm(f, ";ptime=1;audio_player=mock-auplay,a"); + fixture_init_prm(f, ";ptime=5;audio_player=mock-auplay,a"); mem_deref(f->b.ua); err = ua_alloc(&f->b.ua, "B " - ";regint=0;ptime=1;audio_player=mock-auplay,b"); + ";regint=0;ptime=5;audio_player=mock-auplay,b"); TEST_ERR(err); conf_config()->audio.txmode = txmode; - conf_config()->audio.src_fmt = fmt; - conf_config()->audio.play_fmt = fmt; + conf_config()->audio.src_fmt = sndfmt; + conf_config()->audio.channels_src = 1; + conf_config()->audio.play_fmt = sndfmt; + conf_config()->audio.enc_fmt = acfmt; + conf_config()->audio.dec_fmt = acfmt; conf_config()->avt.rtp_stats = true; cancel_rule_new(UA_EVENT_CUSTOM, f->a.ua, 0, 0, 1); @@ -1839,7 +1843,7 @@ static int test_media_base(enum audio_mode txmode, enum aufmt fmt) TEST_ERR(err); /* run main-loop with timeout, wait for events */ - err = re_main_timeout(10000); + err = re_main_timeout(1000); TEST_ERR(err); TEST_ERR(fix.err); @@ -1878,19 +1882,31 @@ int test_call_format_float(void) err = module_load(".", "auconv"); TEST_ERR(err); - err = test_media_base(AUDIO_MODE_POLL, AUFMT_S16LE); + err = module_load(".", "auresamp"); TEST_ERR(err); - err = test_media_base(AUDIO_MODE_THREAD, AUFMT_S16LE); + err = module_load(".", "opus"); TEST_ERR(err); - err = test_media_base(AUDIO_MODE_POLL, AUFMT_FLOAT); + err = test_media_base(AUDIO_MODE_POLL, AUFMT_S16LE, AUFMT_S16LE); TEST_ERR(err); - err = test_media_base(AUDIO_MODE_THREAD, AUFMT_FLOAT); + err = test_media_base(AUDIO_MODE_POLL, AUFMT_S16LE, AUFMT_FLOAT); TEST_ERR(err); +/* TODO: sound card float / ac s16le; wait for PR of @sreimers */ + +/* TODO: POLL mode*/ +/* err = test_media_base(AUDIO_MODE_POLL, AUFMT_FLOAT, AUFMT_S16LE);*/ +/* TEST_ERR(err);*/ + +/* err = test_media_base(AUDIO_MODE_THREAD, AUFMT_S16LE);*/ +/* TEST_ERR(err);*/ + out: + /* TODO: fix double free or corruption crash */ + module_unload("opus"); + module_unload("auresamp"); module_unload("auconv"); return err;