From df0ad6c1a4e23a96428e435af7ba54c2f367546b Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 19 Apr 2018 12:29:45 +0200 Subject: osmux: Move examples and tests to use new output APIs Change-Id: Ie69c427308eb7d81aedab7fbb71f1bdaf43f0275 --- examples/osmux-test-output.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'examples') diff --git a/examples/osmux-test-output.c b/examples/osmux-test-output.c index 9b7c113..0ab03a7 100644 --- a/examples/osmux-test-output.c +++ b/examples/osmux-test-output.c @@ -88,7 +88,6 @@ int read_cb(struct osmo_dgram *conn) { struct msgb *msg; struct osmux_hdr *osmuxh; - struct llist_head list; LOGP(DOSMUX_TEST, LOGL_DEBUG, "received message from datagram\n"); @@ -107,10 +106,8 @@ int read_cb(struct osmo_dgram *conn) LOGP(DOSMUX_TEST, LOGL_DEBUG, "received OSMUX message (len=%d) %s\n", msg->len, buf); - while((osmuxh = osmux_xfrm_output_pull(msg)) != NULL) { - osmux_xfrm_output(osmuxh, &h_output, &list); - osmux_tx_sched(&list, tx_cb, NULL); - } + while((osmuxh = osmux_xfrm_output_pull(msg)) != NULL) + osmux_xfrm_output_sched(&h_output, osmuxh); return 0; } @@ -120,6 +117,7 @@ void sighandler(int foo) LOGP(DOSMUX_TEST, LOGL_NOTICE, "closing OSMUX.\n"); osmo_dgram_close(conn); osmo_dgram_destroy(conn); + osmux_xfrm_output_flush(&h_output); osmo_rtp_handle_free(rtp); amr_close(); exit(EXIT_SUCCESS); @@ -158,7 +156,7 @@ int main(int argc, char *argv[]) * initialize OSMUX handlers. */ osmux_xfrm_output_init(&h_output, random()); - + osmux_xfrm_output_set_tx_cb(&h_output, tx_cb, NULL); /* * initialize datagram server. */ -- cgit v1.2.3