diff --git a/encoder/null_encoder.cpp b/encoder/null_encoder.cpp index ebc39719..a80dc60b 100644 --- a/encoder/null_encoder.cpp +++ b/encoder/null_encoder.cpp @@ -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); } }