Skip to content

Commit

Permalink
rtprecv: correct error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
cspiel1 committed Oct 3, 2023
1 parent 5364304 commit 2809252
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/rtprecv.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,8 @@ int rtprecv_alloc(struct rtp_receiver **rxp,
rx->pt = -1;
err = str_dup(&rx->name, name);
err |= mutex_alloc(&rx->mtx);
if (err)
goto out;

/* Audio Jitter buffer */
if (stream_type(strm) == MEDIA_AUDIO &&
Expand All @@ -461,17 +463,19 @@ int rtprecv_alloc(struct rtp_receiver **rxp,

err = jbuf_alloc(&rx->jbuf, cfg->video.jbuf_del.min,
cfg->video.jbuf_del.max);
err |= jbuf_set_type(rx->jbuf, cfg->video.jbtype);
if (err)
goto out;

err = jbuf_set_type(rx->jbuf, cfg->video.jbtype);
if (err)
goto out;
}

rx->metric = metric_alloc();
if (!rx->metric)
err |= ENOMEM;
err = ENOMEM;
else
err |= metric_init(rx->metric);

if (err)
goto out;
err = metric_init(rx->metric);

out:
if (err)
Expand Down

0 comments on commit 2809252

Please sign in to comment.