Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Commit

Permalink
aubuf: fix possible data race warning (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
cspiel1 authored Jun 7, 2022
1 parent 5d3a1fc commit d295d59
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/aubuf/aubuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ int aubuf_write_auframe(struct aubuf *ab, const struct auframe *af)
struct mbuf *mb;
size_t sz;
size_t sample_size;
bool ajb;
int err;

if (!ab || !af)
Expand All @@ -293,9 +294,10 @@ int aubuf_write_auframe(struct aubuf *ab, const struct auframe *af)

lock_write_get(ab->lock);
mem_deref(mb);
ajb = !ab->filling && ab->ajb;
lock_rel(ab->lock);

if (!ab->filling && ab->ajb)
if (ajb)
ajb_calc(ab->ajb, af, ab->cur_sz);

return err;
Expand Down

0 comments on commit d295d59

Please sign in to comment.