Send generic as one write

There's no need to separate to write the header and then write the
payload when the frame has both fields and their lengths
This commit is contained in:
Aaro Altonen 2019-05-28 09:47:15 +03:00
parent 4305ec04f0
commit 18a161489f
1 changed files with 2 additions and 7 deletions

View File

@ -85,13 +85,8 @@ rtp_error_t kvz_rtp::sender::write_generic_frame(kvz_rtp::connection *conn, kvz_
rtp_error_t ret;
if ((ret = kvz_rtp::sender::write_generic_header(conn, frame->header, frame->header_len)) != RTP_OK) {
LOG_ERROR("Failed to send header! Size %zu, Type %d", frame->header_len, frame->frame_type);
return ret;
}
if ((ret = kvz_rtp::sender::write_payload(conn, frame->data, frame->data_len)) != RTP_OK) {
LOG_ERROR("Failed to send payload! Size %zu, Type %d", frame->data_len, frame->frame_type);
if ((ret = kvz_rtp::sender::write_payload(conn, frame->data, frame->total_len)) != RTP_OK) {
LOG_ERROR("Failed to send payload! Size %zu, Type %d", frame->total_len, frame->type);
return ret;
}