Skip to content

Commit

Permalink
rtp: Exit with failure if FEC init fails
Browse files Browse the repository at this point in the history
  • Loading branch information
mpiatka committed Oct 5, 2023
1 parent 4c250bd commit 4015350
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/video_rxtx/rtp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,18 @@ struct response *rtp_video_rxtx::process_sender_message(struct msg_sender *msg)
}
m_fec_state = fec::create_from_config(msg->fec_cfg);
if (!m_fec_state) {
m_fec_state = old_fec_state;
if (strstr(msg->fec_cfg, "help") != nullptr || m_frames_sent == 0ULL) { // -f LDGM:help or so + init
exit_uv(0);
} else {
int rc = 0;
if(strstr(msg->fec_cfg, "help") == nullptr){
LOG(LOG_LEVEL_ERROR) << "[control] Unable to initalize FEC!\n";
rc = 1;
}

//Exit only if we failed because of command line params, not control port msg
if (m_frames_sent == 0ULL) {
exit_uv(rc);
}

m_fec_state = old_fec_state;
return new_response(RESPONSE_INT_SERV_ERR, NULL);
}
delete old_fec_state;
Expand Down

0 comments on commit 4015350

Please sign in to comment.