diff options
author | Max <msuraev@sysmocom.de> | 2016-04-26 15:25:21 +0200 |
---|---|---|
committer | Max <msuraev@sysmocom.de> | 2016-04-26 17:23:34 +0200 |
commit | 4e3d451c4a301a7fc8c84813dd8c238f4728998b (patch) | |
tree | d877842839dbbe3fc0038c15efba7d5b0421320b | |
parent | 86c9e4597c1c4a9be160bd44b8a8dc7d13c0b59c (diff) |
simplify frame send routine
ortp: use higher-level function for sending RTP frames.
-rw-r--r-- | src/trau/osmo_ortp.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index f918b4a..5117a2c 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -420,23 +420,9 @@ int osmo_rtp_socket_connect(struct osmo_rtp_socket *rs, const char *ip, uint16_t int osmo_rtp_send_frame(struct osmo_rtp_socket *rs, const uint8_t *payload, unsigned int payload_len, unsigned int duration) { - mblk_t *mblk; - int rc; - - mblk = rtp_session_create_packet(rs->sess, RTP_FIXED_HEADER_SIZE, - payload, payload_len); - if (!mblk) - return -ENOMEM; - - rc = rtp_session_sendm_with_ts(rs->sess, mblk, - rs->tx_timestamp); + int rc = rtp_session_send_with_ts(rs->sess, payload, payload_len, + rs->tx_timestamp); rs->tx_timestamp += duration; - if (rc < 0) { - /* no need to free() the mblk, as rtp_session_rtp_send() - * unconditionally free()s the mblk even in case of - * error */ - return rc; - } return rc; } |