mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 13:40:21 +00:00
FEC: some fixes
This commit is contained in:
@@ -90,13 +90,14 @@ rs::rs(const char *c_cfg)
|
||||
m_k = DEFAULT_K;
|
||||
m_n = DEFAULT_N;
|
||||
}
|
||||
assert (m_k <= MAX_K);
|
||||
assert (m_n <= MAX_N);
|
||||
assert (m_k <= m_n);
|
||||
free(cfg);
|
||||
if (m_k > MAX_K || m_n > MAX_N || m_k > m_n) {
|
||||
usage();
|
||||
throw 1;
|
||||
}
|
||||
|
||||
state = fec_new(m_k, m_n);
|
||||
assert(state != NULL);
|
||||
free(cfg);
|
||||
}
|
||||
|
||||
rs::~rs()
|
||||
|
||||
@@ -143,14 +143,28 @@ struct response *rtp_video_rxtx::process_sender_message(struct msg_sender *msg)
|
||||
case SENDER_MSG_CHANGE_FEC:
|
||||
{
|
||||
lock_guard<mutex> lock(m_network_devices_lock);
|
||||
delete m_fec_state;
|
||||
auto old_fec_state = m_fec_state;
|
||||
m_fec_state = NULL;
|
||||
if (strcmp(msg->fec_cfg, "flush") != 0) {
|
||||
m_fec_state = fec::create_from_config(msg->fec_cfg);
|
||||
if (strcmp(msg->fec_cfg, "flush") == 0) {
|
||||
delete old_fec_state;
|
||||
} else {
|
||||
int ret = -1;
|
||||
try {
|
||||
m_fec_state = fec::create_from_config(msg->fec_cfg);
|
||||
} catch (int i) {
|
||||
ret = i;
|
||||
} catch (...) {
|
||||
}
|
||||
if (!m_fec_state) {
|
||||
log_msg(LOG_LEVEL_ERROR, "[control] Unable to initalize FEC!\n");
|
||||
if (ret != 0) {
|
||||
log_msg(LOG_LEVEL_ERROR, "[control] Unable to initalize FEC!\n");
|
||||
m_fec_state = old_fec_state;
|
||||
} else { // -f LDGM:help or so
|
||||
exit_uv(0);
|
||||
}
|
||||
return new_response(RESPONSE_INT_SERV_ERR, NULL);
|
||||
} else {
|
||||
delete old_fec_state;
|
||||
log_msg(LOG_LEVEL_NOTICE, "[control] Fec changed successfully\n");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user