pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29525 )
Change subject: cosmetic: osmux: Make litner happy ......................................................................
cosmetic: osmux: Make litner happy
Change-Id: I8472e1b508babfa231c7e0ecc75b4fe63e090a0d --- M src/osmux_input.c M src/osmux_output.c 2 files changed, 29 insertions(+), 29 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/25/29525/1
diff --git a/src/osmux_input.c b/src/osmux_input.c index 2b388f2..2706b11 100644 --- a/src/osmux_input.c +++ b/src/osmux_input.c @@ -178,7 +178,7 @@ osmuxh->ft = OSMUX_FT_DUMMY; osmuxh->ctr = batch_factor - 1; osmuxh->amr_f = 0; - osmuxh->amr_q= 0; + osmuxh->amr_q = 0; osmuxh->seq = 0; osmuxh->circuit_id = state->circuit->ccid; osmuxh->amr_cmr = 0; @@ -370,7 +370,7 @@ /* If diff between last RTP packet seen and this one is > 1, * then we lost several RTP packets, let's replay them. */ - for (i=1; i<diff; i++) { + for (i = 1; i < diff; i++) { struct msgb *clone;
/* Clone last RTP packet seen */ @@ -556,33 +556,33 @@ return -1; }
- switch(rtph->payload_type) { - case RTP_PT_RTCP: - LOGP(DLMUX, LOGL_INFO, "Dropping RTCP packet\n"); + switch (rtph->payload_type) { + case RTP_PT_RTCP: + LOGP(DLMUX, LOGL_INFO, "Dropping RTCP packet\n"); + msgb_free(msg); + return 0; + default: + /* The RTP payload type is dynamically allocated, + * although we use static ones. Assume that we always + * receive AMR traffic. + */ + + /* Add this RTP to the OSMUX batch */ + ret = osmux_batch_add(batch, h->batch_factor, + msg, rtph, ccid); + if (ret < 0) { + /* Cannot put this message into the batch. + * Malformed, duplicated, OOM. Drop it and tell + * the upper layer that we have digest it. + */ + LOGP(DLMUX, LOGL_DEBUG, "Dropping RTP packet instead of adding to batch\n"); msgb_free(msg); - return 0; - default: - /* The RTP payload type is dynamically allocated, - * although we use static ones. Assume that we always - * receive AMR traffic. - */ + return ret; + }
- /* Add this RTP to the OSMUX batch */ - ret = osmux_batch_add(batch, h->batch_factor, - msg, rtph, ccid); - if (ret < 0) { - /* Cannot put this message into the batch. - * Malformed, duplicated, OOM. Drop it and tell - * the upper layer that we have digest it. - */ - LOGP(DLMUX, LOGL_DEBUG, "Dropping RTP packet instead of adding to batch\n"); - msgb_free(msg); - return ret; - } - - h->stats.input_rtp_msgs++; - h->stats.input_rtp_bytes += msg->len; - break; + h->stats.input_rtp_msgs++; + h->stats.input_rtp_bytes += msg->len; + break; } return ret; } diff --git a/src/osmux_output.c b/src/osmux_output.c index 069bdd9..a6e6513 100644 --- a/src/osmux_output.c +++ b/src/osmux_output.c @@ -203,7 +203,7 @@ }
/*! \brief Generate RTP packets from osmux frame AMR payload set and schedule - * them for transmission at appropiate time. + * them for transmission at appropriate time. * \param[in] h the osmux out handle handling a specific CID * \param[in] osmuxh Buffer pointing to osmux frame header structure and AMR payload * \return Number of generated RTP packets @@ -252,7 +252,7 @@ h->osmux_seq_ack = osmuxh->seq;
/* In case list is still empty after parsing messages, no need to rearm */ - if(was_empty && !llist_empty(&h->list)) + if (was_empty && !llist_empty(&h->list)) osmux_xfrm_output_trigger(h); return i; }