mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 21:22:09 +00:00
[mod_opus] Fix status returned by switch_opus_decode(). Should be SWITCH_STATUS_FALSE instead of SWITCH_STATUS_NOOP. Add a unit-test.
This commit is contained in:
@@ -127,6 +127,32 @@ FST_CORE_BEGIN("./conf")
|
||||
|
||||
}
|
||||
FST_TEST_END()
|
||||
|
||||
FST_TEST_BEGIN(test_mod_opus_switch_status_false)
|
||||
{
|
||||
signed char outbuf[SWITCH_RECOMMENDED_BUFFER_SIZE] = { 0 };
|
||||
uint32_t decoded_len = 0;
|
||||
uint32_t decoded_rate = 48000;
|
||||
unsigned int flags = 0;
|
||||
switch_codec_t orig_codec = { 0 };
|
||||
switch_status_t status;
|
||||
switch_codec_settings_t codec_settings = { { 0 } };
|
||||
status = switch_core_codec_init(&orig_codec,
|
||||
"OPUS",
|
||||
"mod_opus",
|
||||
NULL,
|
||||
48000,
|
||||
20,
|
||||
1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
|
||||
&codec_settings, fst_pool);
|
||||
fst_check(status == SWITCH_STATUS_SUCCESS);
|
||||
|
||||
status = switch_core_codec_decode(&orig_codec, NULL, "test", 5, 48000, outbuf, &decoded_len, &decoded_rate, &flags);
|
||||
fst_check_int_equals(status, SWITCH_STATUS_FALSE);
|
||||
switch_core_codec_destroy(&orig_codec);
|
||||
}
|
||||
FST_TEST_END()
|
||||
|
||||
}
|
||||
FST_SUITE_END()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user