Skip to content

Commit

Permalink
output: null_encoder: Fix bug in ordering of input/output callbacks
Browse files Browse the repository at this point in the history
This would cause a pop from the metadata queue in the output callback before
the input callback has a chance to push to the queue.

Signed-off-by: Naushir Patuck <[email protected]>
  • Loading branch information
naushir committed Dec 1, 2022
1 parent 4068771 commit 9c5d319
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion encoder/null_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ void NullEncoder::outputThread()
return;
}
}
output_ready_callback_(item.mem, item.length, item.timestamp_us, true);
// Ensure the input done callback happens before the output ready callback.
// This is needed as the metadata queue gets pushed in the former, and popped
// in the latter.
input_done_callback_(nullptr);
output_ready_callback_(item.mem, item.length, item.timestamp_us, true);
}
}

0 comments on commit 9c5d319

Please sign in to comment.