Browse Source

TT#108003 remove unnecessary null checks

Change-Id: I1aeb10662eac2ed0553cf4489d1e1d7a487ad272
pull/1194/head
Richard Fuchs 5 years ago
parent
commit
7101f535da
6 changed files with 10 additions and 19 deletions
  1. +2
    -3
      daemon/codec.c
  2. +2
    -2
      daemon/media_socket.c
  3. +3
    -9
      daemon/redis.c
  4. +1
    -2
      daemon/rtcp.c
  5. +1
    -2
      daemon/udp_listener.c
  6. +1
    -1
      recording-daemon/decoder.c

+ 2
- 3
daemon/codec.c View File

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


+ 2
- 2
daemon/media_socket.c View File

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


+ 3
- 9
daemon/redis.c View File

@ -631,15 +631,9 @@ static int redis_delete_async(struct redis *r) {
return -1; 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; return 0;
} }


+ 1
- 2
daemon/rtcp.c View File

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


+ 1
- 2
daemon/udp_listener.c View File

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


+ 1
- 1
recording-daemon/decoder.c View File

@ -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 = ... // mono/stereo mixing goes here: out_format.channels = ...
if (outp) { if (outp) {
// if this output has been configured already, re-use the same format // 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; out_format = outp->encoder->requested_format;
output_config(outp, &out_format, &out_format); output_config(outp, &out_format, &out_format);
// save the returned sample format so we don't output_config() twice // save the returned sample format so we don't output_config() twice


Loading…
Cancel
Save