From 95a7cc6cfb1a52673ea3b77d30a4fe4a9d82f81c Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 17 May 2018 10:38:01 -0400 Subject: [PATCH] eliminate redundant function argument Change-Id: I5bff4436072c2855590e08d90c5098af3abceb93 --- daemon/codec.c | 16 +++++----------- daemon/media_socket.c | 2 +- include/codec.h | 2 +- t/transcode-test.c | 2 +- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/daemon/codec.c b/daemon/codec.c index 0660d2be1..dc522fd52 100644 --- a/daemon/codec.c +++ b/daemon/codec.c @@ -440,9 +440,7 @@ void codec_add_raw_packet(struct media_packet *mp) { mp->ssrc_out->payload_type = mp->rtp->m_pt & 0x7f; g_queue_push_tail(&mp->packets_out, p); } -static int handler_func_passthrough(struct codec_handler *h, struct call_media *media, - struct media_packet *mp) -{ +static int handler_func_passthrough(struct codec_handler *h, struct media_packet *mp) { codec_add_raw_packet(mp); return 0; } @@ -546,11 +544,9 @@ struct rtp_payload_type *codec_make_payload_type(const str *codec_str, struct ca #ifdef WITH_TRANSCODING -static int handler_func_passthrough_ssrc(struct codec_handler *h, struct call_media *media, - struct media_packet *mp) -{ +static int handler_func_passthrough_ssrc(struct codec_handler *h, struct media_packet *mp) { if (G_UNLIKELY(!mp->rtp)) - return handler_func_passthrough(h, media, mp); + return handler_func_passthrough(h, mp); // substitute out SSRC mp->rtp->ssrc = htonl(mp->ssrc_in->ssrc_map_out); @@ -722,11 +718,9 @@ static int __packet_decoded(decoder_t *decoder, AVFrame *frame, void *u1, void * return 0; } -static int handler_func_transcode(struct codec_handler *h, struct call_media *media, - struct media_packet *mp) -{ +static int handler_func_transcode(struct codec_handler *h, struct media_packet *mp) { if (G_UNLIKELY(!mp->rtp)) - return handler_func_passthrough(h, media, mp); + return handler_func_passthrough(h, mp); assert((mp->rtp->m_pt & 0x7f) == h->source_pt.payload_type); diff --git a/daemon/media_socket.c b/daemon/media_socket.c index 515d1d787..f514da805 100644 --- a/daemon/media_socket.c +++ b/daemon/media_socket.c @@ -1649,7 +1649,7 @@ static int stream_packet(struct packet_handler_ctx *phc) { else { struct codec_handler *transcoder = codec_handler_get(phc->mp.media, phc->payload_type); // this transfers the packet from 's' to 'packets_out' - if (transcoder->func(transcoder, phc->mp.media, &phc->mp)) + if (transcoder->func(transcoder, &phc->mp)) goto drop; } diff --git a/include/codec.h b/include/codec.h index 83ed9259f..278275c66 100644 --- a/include/codec.h +++ b/include/codec.h @@ -16,7 +16,7 @@ struct ssrc_hash; struct sdp_ng_flags; -typedef int codec_handler_func(struct codec_handler *, struct call_media *, struct media_packet *); +typedef int codec_handler_func(struct codec_handler *, struct media_packet *); struct codec_handler { diff --git a/t/transcode-test.c b/t/transcode-test.c index 716b52ade..973bdc29e 100644 --- a/t/transcode-test.c +++ b/t/transcode-test.c @@ -102,7 +102,7 @@ static void queue_dump(GString *s, GQueue *q) { memcpy(mp.payload.s, pl.s, pl.len); \ mp.raw.s = packet; \ mp.raw.len = packet_len; \ - h->func(h, media_A, &mp); \ + h->func(h, &mp); \ if (pt_out == -1) { \ if (mp.packets_out.length != 0) { \ printf("test failed: %s:%i\n", __FILE__, __LINE__); \