TT#108003 remove unnecessary null checks

Change-Id: I1aeb10662eac2ed0553cf4489d1e1d7a487ad272
pull/1194/head
Richard Fuchs 4 years ago
parent 225e5add8f
commit 7101f535da

@ -1729,7 +1729,7 @@ static int __handler_func_sequencer(struct media_packet *mp, struct transcode_pa
struct codec_handler *h = packet->handler;
if (G_UNLIKELY(!h->ssrc_hash)) {
if (!packet->func || !packet->handler || !packet->handler->ssrc_hash) {
if (!packet->func || !packet->handler->ssrc_hash) {
h->func(h, mp);
return 0;
}
@ -1999,8 +1999,7 @@ static int packet_dtmf_fwd(struct codec_ssrc_handler *ch, struct transcode_packe
skip:
if (output_ch)
obj_put(&output_ch->h);
if (decoder_ch)
obj_put(&decoder_ch->h);
obj_put(&decoder_ch->h);
}
char *buf = malloc(packet->payload->len + sizeof(struct rtp_header) + RTP_BUFFER_TAIL_ROOM);

@ -1583,7 +1583,7 @@ static void media_packet_rtcp_demux(struct packet_handler_ctx *phc)
}
}
phc->out_srtp = phc->sink;
if (phc->rtcp && phc->sink && phc->sink->rtcp_sibling)
if (phc->rtcp && phc->sink->rtcp_sibling)
phc->out_srtp = phc->sink->rtcp_sibling; // use RTCP SRTP context
phc->mp.media_out = phc->sink->media;
@ -1996,7 +1996,7 @@ static int stream_packet(struct packet_handler_ctx *phc) {
if (!phc->mp.stream->selected_sfd)
goto out;
if (phc->mp.call && phc->mp.call->drop_traffic) {
if (phc->mp.call->drop_traffic) {
goto drop;
}

@ -631,15 +631,9 @@ static int redis_delete_async(struct redis *r) {
return -1;
}
// loopbreak => NOT NULL context
if (r->async_ctx) {
redisAsyncDisconnect(r->async_ctx);
r->async_ctx = NULL;
// disconnect => NULL context set in callback
} else {
return 1;
}
// loopbreak
redisAsyncDisconnect(r->async_ctx);
r->async_ctx = NULL;
return 0;
}

@ -1354,8 +1354,7 @@ static void transcode_rr(struct rtcp_process_ctx *ctx, struct report_block *rr)
out:
if (input_ctx)
obj_put(&input_ctx->parent->h);
if (map_ctx)
obj_put(&map_ctx->parent->h);
obj_put(&map_ctx->parent->h);
}
static void transcode_sr(struct rtcp_process_ctx *ctx, struct sender_report_packet *sr) {
if (!ctx->mp->ssrc_in)

@ -61,8 +61,7 @@ static void udp_listener_incoming(int fd, void *p, uintptr_t x) {
udp_buf = NULL;
}
}
if (udp_buf)
obj_put(udp_buf);
obj_put(udp_buf);
}
static void __ulc_free(void *p) {

@ -72,7 +72,7 @@ decode_t *decoder_new(const char *payload_str, const char *format, int ptime, ou
// mono/stereo mixing goes here: out_format.channels = ...
if (outp) {
// if this output has been configured already, re-use the same format
if (outp->encoder && outp->encoder->requested_format.format != -1)
if (outp->encoder->requested_format.format != -1)
out_format = outp->encoder->requested_format;
output_config(outp, &out_format, &out_format);
// save the returned sample format so we don't output_config() twice

Loading…
Cancel
Save